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§
Sourcefn serialized_length_at_end(&self) -> usize
fn serialized_length_at_end(&self) -> usize
determine serialized length of frame at the end of the packet
Sourcefn write_to_end(&self, buf: &mut [u8]) -> usize
fn write_to_end(&self, buf: &mut [u8]) -> usize
write last frame of packet to buffer, returning serialized length
Sourcefn read_to_end(buf: &[u8]) -> Result<Self, ()>where
Self: Sized,
fn read_to_end(buf: &[u8]) -> Result<Self, ()>where
Self: Sized,
read last frame of packet from buffer, returning frame
Sourcefn has_end_optimization() -> boolwhere
Self: Sized,
fn has_end_optimization() -> boolwhere
Self: Sized,
whether the frame has special “serialize to end” behavior