pub struct Fragment {
pub reliability: Reliability,
pub more: bool,
pub sn: TransportSn,
pub payload: ZSlice,
pub ext_qos: QoSType,
pub ext_first: Option<First>,
pub ext_drop: Option<Drop>,
}Expand description
§Fragment message
The Fragment message is used to transmit on the wire large NetworkMessage
that require fragmentation because they are larger than the maximum batch size
(i.e. 2^16-1) and/or the link MTU.
The Fragment message flow is the following:
A B
| FRAGMENT(MORE) |
|------------------>|
| FRAGMENT(MORE) |
|------------------>|
| FRAGMENT(MORE) |
|------------------>|
| FRAGMENT |
|------------------>|
| |The Fragment message structure is defined as follows:
Flags:
- R: Reliable If R==1 it concerns the reliable channel, else the best-effort channel
- M: More If M==1 then other fragments will follow
- Z: Extensions If Z==1 then zenoh extensions will follow.
7 6 5 4 3 2 1 0
+-+-+-+-+-+-+-+-+
|Z|M|R| FRAGMENT|
+-+-+-+---------+
% seq num %
+---------------+
~ [FragExts] ~ if Flag(Z)==1
+---------------+
~ [u8] ~
+---------------+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§more: bool§sn: TransportSn§payload: ZSlice§ext_qos: QoSType§ext_first: Option<First>§ext_drop: Option<Drop>Trait Implementations§
Source§impl From<Fragment> for TransportMessage
impl From<Fragment> for TransportMessage
impl Eq for Fragment
impl StructuralPartialEq for Fragment
Auto Trait Implementations§
impl Freeze for Fragment
impl !RefUnwindSafe for Fragment
impl Send for Fragment
impl Sync for Fragment
impl Unpin for Fragment
impl !UnwindSafe for Fragment
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
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>
Converts
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>
Converts
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