Expand description
Core types, traits, and abstractions for nros
This crate provides the foundational types and traits for nros:
RosMessagetrait for message typesRosServicetrait for service typesRosActiontrait for action typesServiceServerandServiceClientfor service communication- Time and Duration types
- Error types
Re-exports§
pub use action::ActionClient;pub use action::ActionServer;pub use action::CancelResponse;pub use action::CancelReturnCode;pub use action::GoalId;pub use action::GoalInfo;pub use action::GoalResponse;pub use action::GoalStatus;pub use action::GoalStatusStamped;pub use action::RosAction;pub use clock::Clock;pub use clock::ClockType;pub use codegen_version::NROS_CODEGEN_VERSION;pub use codegen_version::NROS_CODEGEN_VERSION_MIN;pub use lifecycle::LifecycleState;pub use lifecycle::LifecycleTransition;pub use lifecycle::TransitionResult;pub use logger::Logger;pub use logger::OnceFlag;pub use message_info::MessageInfo;pub use message_info::PUBLISHER_GID_SIZE;pub use message_info::RawMessageInfo;pub use service::ServiceCallback;pub use service::ServiceClient;pub use service::ServiceRequest;pub use service::ServiceServer;pub use time::Duration;pub use time::Time;pub use types::RosMessage;pub use types::RosService;pub use types::ViewableMessage;pub use heapless;
Modules§
- action
- ROS 2 Action types
- clock
- Clock API for nros
- codegen_
version - RFC-0090 / phase-429 — the codegen version, the one token that says whether generated code and this runtime can work together.
- heap
- Heap-backed containers for generated
mode = "heap"message fields (RFC-0033). Gated onalloc, whichstdimplies — so a hosted consumer gets these by asking forstdand never has to namealloc.nros-serdesgates its matchingSerialize/Deserializeimpls on the SAME feature and receives it through the same forward, which is what issue 0598 was about. Generated code refers tonros_core::heap::{Vec, String}so the same path works in both crate and inline (build.rs) codegen modes. - lifecycle
- Lifecycle state machine types (REP-2002)
- logger
- ROS 2 compatible logging utilities
- message_
info - Message metadata for received messages
- service
- ROS 2 Service types
- time
- ROS time types.
- types
- Core ROS type traits.
Structs§
- CdrReader
- CDR reader for deserialization
- CdrWriter
- DHeader
Mark - Opaque marker returned by
CdrWriter::begin_dheader, passed back toCdrWriter::end_dheader. Under XCDR1 it carries nothing (the DHEADER calls are no-ops); under XCDR2 it holds the reserved DHEADER position. - DHeader
Scope - Opaque scope returned by
CdrReader::begin_dheader, passed back toCdrReader::end_dheader. Under XCDR1 it carries nothing (no-op); under XCDR2 it holds the absolute buffer offset of the delimited struct’s end. - LeSlice
View - A borrowed, alignment-agnostic view over a CDR little-endian numeric
sequence (RFC-0033
borrowedmode). Borrows the raw payload bytes zero-copy; decodes elements lazily on access, so the source buffer need not beT-aligned. Valid only for the borrow lifetime'a(the subscription callback scope).
Enums§
- Deser
Error - Deserialization error.
- Encoding
Version - CDR writer for serialization.
- SerError
- Serialization error.
Traits§
- Deserialize
- Trait for types that can be deserialized from CDR format
- Deserialize
View - Trait for borrowed (zero-copy) deserialization from CDR format (RFC-0033
borrowedstorage mode, issue 0007). - LeDecode
- A little-endian-decodable fixed-width numeric element of a borrowed sequence.
- Serialize
- Trait for types that can be serialized to CDR format