Struct zenoh_protocol::proto::Frame [−][src]
Frame 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.
7 6 5 4 3 2 1 0
+-+-+-+-+-+-+-+-+
|E|F|R| FRAME |
+-+-+-+-+-------+
~ SN ~
+---------------+
~ FramePayload ~ -- if F==1 then the payload is a fragment of a single Zenoh Message, a list of complete Zenoh Messages otherwise.
+---------------+
- if R==1 then the FRAME is sent on the reliable channel, best-effort otherwise.
- if F==1 then the FRAME is a fragment.
- if E==1 then the FRAME is the last fragment. E==1 is valid iff F==1.
NOTE: Only one bit would be sufficient to signal fragmentation in a IP-like fashion as follows:
- if F==1 then this FRAME is a fragment and more fragment will follow;
- if F==0 then the message is the last fragment if SN-1 had F==1,
otherwise it's a non-fragmented message.
However, this would require to always perform a two-steps de-serialization: first
de-serialize the FRAME and then the Payload. This is due to the fact the F==0 is ambigous
w.r.t. detecting if the FRAME is a fragment or not before SN re-ordering has occured.
By using the F bit to only signal whether the FRAME is fragmented or not, it allows to
de-serialize the payload in one single pass when F==0 since no re-ordering needs to take
place at this stage. Then, the F bit is used to detect the last fragment during re-ordering.
Fields
ch: Channel
sn: ZInt
payload: FramePayload
Trait Implementations
impl Clone for Frame
[src]
impl Debug for Frame
[src]
impl PartialEq<Frame> for Frame
[src]
impl StructuralPartialEq for Frame
[src]
Auto Trait Implementations
impl RefUnwindSafe for Frame
[src]
impl Send for Frame
[src]
impl Sync for Frame
[src]
impl Unpin for Frame
[src]
impl UnwindSafe for Frame
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,