pub struct Frame {
pub reliability: Reliability,
pub sn: TransportSn,
pub ext_qos: QoSType,
pub payload: ZSlice,
}
Expand description
§Frame message
The Frame
message is used to transmit one ore more complete serialized
crate::network::NetworkMessage
. I.e., the total length of the
serialized crate::network::NetworkMessage
(s) MUST be smaller
than the maximum batch size (i.e. 2^16-1) and the link MTU.
The Frame
message is used as means to aggregate multiple
crate::network::NetworkMessage
in a single atomic message that
goes on the wire. By doing so, many small messages can be batched together and
share common information like the sequence number.
The Frame
message flow is the following:
A B
| FRAME |
|------------------>|
| |
The Frame
message structure is defined as follows:
Flags:
- R: Reliable If R==1 it concerns the reliable channel, else the best-effort channel
- X: Reserved
- Z: Extensions If Z==1 then zenoh extensions will follow.
7 6 5 4 3 2 1 0
+-+-+-+-+-+-+-+-+
|Z|X|R| FRAME |
+-+-+-+---------+
% seq num %
+---------------+
~ [FrameExts] ~ if Flag(Z)==1
+---------------+
~ [NetworkMsg] ~
+---------------+
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 65535 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 65535 bytes.
Fields§
§reliability: Reliability
§sn: TransportSn
§ext_qos: QoSType
§payload: ZSlice
Trait Implementations§
Source§impl From<Frame> for TransportMessage
impl From<Frame> for TransportMessage
impl Eq for Frame
impl StructuralPartialEq for Frame
Auto Trait Implementations§
impl Freeze for Frame
impl !RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl !UnwindSafe for Frame
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more