DelayedTransmitBuild

Trait DelayedTransmitBuild 

Source
pub trait DelayedTransmitBuild {
    // Required methods
    fn build(self) -> Vec<u8> ;
    fn len(&self) -> usize;
    fn write_into(self, data: &mut [u8]) -> usize;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

A trait for delaying building a byte sequence for transmission

Required Methods§

Source

fn build(self) -> Vec<u8>

Write the packet in to a new Vec.

Source

fn len(&self) -> usize

The length (in bytes) of the produced data.

Source

fn write_into(self, data: &mut [u8]) -> usize

Write the data into a provided output buffer.

Returns the number of bytes written.

Provided Methods§

Source

fn is_empty(&self) -> bool

Whether the resulting data would be empty.

Implementations on Foreign Types§

Source§

impl DelayedTransmitBuild for &[u8]

Source§

fn len(&self) -> usize

Source§

fn build(self) -> Vec<u8>

Source§

fn is_empty(&self) -> bool

Source§

fn write_into(self, data: &mut [u8]) -> usize

Source§

impl DelayedTransmitBuild for Vec<u8>

Source§

fn len(&self) -> usize

Source§

fn build(self) -> Vec<u8>

Source§

fn is_empty(&self) -> bool

Source§

fn write_into(self, data: &mut [u8]) -> usize

Implementors§