kinesin_rdt::frame

Trait SerializeToEnd

Source
pub trait SerializeToEnd: Serialize {
    // Provided methods
    fn serialized_length_at_end(&self) -> usize { ... }
    fn write_to_end(&self, buf: &mut [u8]) -> usize { ... }
    fn read_to_end(buf: &[u8]) -> Result<Self, ()>
       where Self: Sized { ... }
    fn has_end_optimization() -> bool
       where Self: Sized { ... }
}
Expand description

frame serialization allowing optimizations for end-of-packet frames

Provided Methods§

Source

fn serialized_length_at_end(&self) -> usize

determine serialized length of frame at the end of the packet

Source

fn write_to_end(&self, buf: &mut [u8]) -> usize

write last frame of packet to buffer, returning serialized length

Source

fn read_to_end(buf: &[u8]) -> Result<Self, ()>
where Self: Sized,

read last frame of packet from buffer, returning frame

Source

fn has_end_optimization() -> bool
where Self: Sized,

whether the frame has special “serialize to end” behavior

Implementors§