Struct zenoh_protocol::proto::Attachment
source · pub struct Attachment {
pub buffer: ZBuf,
}Expand description
Attachment decorator
NOTE: 16 bits (2 bytes) may be prepended to the serialized message indicating the total length
in bytes of the message, resulting in the maximum length of a message being 65_535 bytes.
This is necessary in those stream-oriented transports (e.g., TCP) that do not preserve
the boundary of the serialized messages. The length is encoded as little-endian.
In any case, the length of a message must not exceed 65_535 bytes.
The Attachment can decorate any message (i.e., TransportMessage and ZenohMessage) and it allows to
append to the message any additional information. Since the information contained in the
Attachement is relevant only to the layer that provided them (e.g., Transport, Zenoh, User) it
is the duty of that layer to serialize and de-serialize the attachment whenever deemed necessary.
The attachement always contains serialized properties.
7 6 5 4 3 2 1 0
+-+-+-+-+-+-+-+-+
|X|X|Z| ATTCH |
+-+-+-+---------+
~ Attachment ~
+---------------+
Fields§
§buffer: ZBufImplementations§
source§impl Attachment
impl Attachment
pub fn new(buffer: ZBuf) -> Attachment
Trait Implementations§
source§impl Clone for Attachment
impl Clone for Attachment
source§fn clone(&self) -> Attachment
fn clone(&self) -> Attachment
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for Attachment
impl Debug for Attachment
source§impl PartialEq<Attachment> for Attachment
impl PartialEq<Attachment> for Attachment
source§fn eq(&self, other: &Attachment) -> bool
fn eq(&self, other: &Attachment) -> bool
This method tests for
self and other values to be equal, and is used
by ==.