pub struct SerializedPayload {
pub representation_identifier: RepresentationIdentifier,
pub representation_options: [u8; 2],
pub value: Bytes,
}Expand description
Part of RTPS DATA submessage: 4-byte header + serialized data A SerializedPayload submessage element contains the serialized representation of either value of an application-defined data-object or the value of the key that uniquely identifies the data-object See RTPS spec v2.3 section 10. Standard representation identifier values are defined in sections 10.2 - 10.5 representation_options “shall be interpreted in the context of the RepresentationIdentifier, such that each RepresentationIdentifier may define the representation_options that it requires.” and “The [2.3] version of the protocol does not use the representation_options: The sender shall set the representation_options to zero. The receiver shall ignore the value of the representation_options.”
Fields§
§representation_identifier: RepresentationIdentifier§representation_options: [u8; 2]§value: BytesImplementations§
Source§impl SerializedPayload
impl SerializedPayload
pub fn new(rep_id: RepresentationIdentifier, payload: Vec<u8>) -> Self
pub fn new_from_bytes(rep_id: RepresentationIdentifier, payload: Bytes) -> Self
Sourcepub fn len_serialized(&self) -> usize
pub fn len_serialized(&self) -> usize
serialized size in bytes
pub fn bytes_slice(&self, from: usize, to_before: usize) -> Bytes
pub fn from_bytes(bytes: &Bytes) -> Result<Self>
Trait Implementations§
Source§impl Clone for SerializedPayload
impl Clone for SerializedPayload
Source§fn clone(&self) -> SerializedPayload
fn clone(&self) -> SerializedPayload
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more