pub trait TopicType: Sized + TypeSupport<Rust = Self> {
const TYPE_NAME: &'static str;
const EXTENSIBILITY: Extensibility;
const KEYED: bool;
// Provided methods
fn to_payload(
&self,
encoding: Encoding,
order: ByteOrder,
) -> Result<Vec<u8>, Error> { ... }
fn from_payload(buf: &[u8]) -> Result<Self, Error> { ... }
fn key_holder(&self) -> Result<Vec<u8>, Error> { ... }
fn key_hash(&self) -> Result<[u8; 16], Error> { ... }
}Expand description
A type a DDS DataWriter publishes: a generated struct or union that is
not @nested (DDS-XTypes 7.3.1.2.1.7 and 7.3.1.2.1.16).
Required Associated Constants§
Sourceconst EXTENSIBILITY: Extensibility
const EXTENSIBILITY: Extensibility
The extensibility kind (@final, @appendable, @mutable).
Provided Methods§
Sourcefn to_payload(
&self,
encoding: Encoding,
order: ByteOrder,
) -> Result<Vec<u8>, Error>
fn to_payload( &self, encoding: Encoding, order: ByteOrder, ) -> Result<Vec<u8>, Error>
The RTPS SerializedPayload of self: the encapsulation header of
encoding (which must be Encoding::Xcdr1 or
Encoding::Xcdr2) and the extensibility of the type, the value,
and the padding to 4 octets (DDS-XTypes 7.4.3.5.3 rule 1,
DDSI-RTPS 10).
Sourcefn from_payload(buf: &[u8]) -> Result<Self, Error>
fn from_payload(buf: &[u8]) -> Result<Self, Error>
Reads a value from an RTPS SerializedPayload. Its format must be the one of the extensibility of the type: PL_CDR or PL_CDR2 for a mutable type, PLAIN_CDR or DELIMITED_CDR for an appendable one, PLAIN_CDR or PLAIN_CDR2 for a final one.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".