Struct zenoh_protocol::proto::Sync

source ·
pub struct Sync {
    pub reliability: Reliability,
    pub sn: ZInt,
    pub count: Option<ZInt>,
}
Expand description

Sync message

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 SYNC message allows to signal the corresponding peer the sequence number of the next message
to be transmitted on the reliable or best-effort channel. In the case of reliable channel, the
peer can optionally include the number of unacknowledged messages. A SYNC sent on the reliable
channel triggers the transmission of an ACKNACK message.

 7 6 5 4 3 2 1 0
+-+-+-+-+-+-+-+-+
|X|C|R|  SYNC   |
+-+-+-+-+-------+
~      sn       ~ -- Sequence number of the next message to be transmitted on this channel.
+---------------+
~     count     ~ if R==1 && C==1 -- Number of unacknowledged messages.
+---------------+

- if R==1 then the SYNC concerns the reliable channel, otherwise the best-effort channel.

Fields§

§reliability: Reliability§sn: ZInt§count: Option<ZInt>

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.