pub struct DdsAny {
pub type_name: String,
pub payload: Vec<u8>,
}Expand description
IDL any as a type-erasure wrapper. Carries a type-identifier
string (e.g. "std_msgs::Header") plus the payload bytes.
Consumer pattern: check type_name, then deserialize the payload
with the concrete DdsType.
Fields§
§type_name: StringFully-qualified type name (matches DdsType::TYPE_NAME).
payload: Vec<u8>XCDR2 payload bytes of the wrapped value.
Implementations§
Trait Implementations§
Source§impl CdrDecode for DdsAny
impl CdrDecode for DdsAny
Source§fn decode(r: &mut BufferReader<'_>) -> Result<Self, DecodeError>
fn decode(r: &mut BufferReader<'_>) -> Result<Self, DecodeError>
Reads this value from the reader (alignment-aware). Read more
Source§const IS_PRIMITIVE: bool = false
const IS_PRIMITIVE: bool = false
XCDR2 primitive classification, symmetric to
CdrEncode::IS_PRIMITIVE. Controls DHEADER reading when
decoding sequence<T>/T[N] with non-primitive T.Source§impl CdrEncode for DdsAny
impl CdrEncode for DdsAny
Source§fn encode(&self, w: &mut BufferWriter) -> Result<(), EncodeError>
fn encode(&self, w: &mut BufferWriter) -> Result<(), EncodeError>
Writes this value into the writer (alignment-aware). Read more
Source§const IS_PRIMITIVE: bool = false
const IS_PRIMITIVE: bool = false
XCDR2 primitive classification (OMG XTypes 1.3 §7.4.3.5):
true
only for primitives (bool, octet, int8/16/32/64, uint8/16/32/64,
float, double, char/wchar). false for aggregate/variable
types (string, struct, union, enum, sequence, array, map).
Controls DHEADER prepending for sequence<T>/T[N]:
collections with NON-primitive elements need a DHEADER (uint32 =
byte length of the following content) under XCDR2.impl Eq for DdsAny
impl StructuralPartialEq for DdsAny
Auto Trait Implementations§
impl Freeze for DdsAny
impl RefUnwindSafe for DdsAny
impl Send for DdsAny
impl Sync for DdsAny
impl Unpin for DdsAny
impl UnsafeUnpin for DdsAny
impl UnwindSafe for DdsAny
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more