Trait BufferIntoInner

Source
pub trait BufferIntoInner<B>
where B: AsRef<[u8]>,
{ // Required methods fn data_length(&self) -> usize; fn headroom(&self) -> usize; fn buffer_into_inner(self) -> B; fn buffer_get_ref(&self) -> &[u8]; }
Expand description

Provides access to the underlying data buffer.

Required Methods§

Source

fn data_length(&self) -> usize

Returns the data length.

Data length is the amount of bytes from the first header byte to the end of the payload.

Source

fn headroom(&self) -> usize

Returns the amount of headroom the buffer currently has.

Source

fn buffer_into_inner(self) -> B

Returns the underlying buffer.

Source

fn buffer_get_ref(&self) -> &[u8]

Returns a reference to the underlying buffer.

Implementors§

Source§

impl<B, HM> BufferIntoInner<B> for DataBuffer<B, HM>
where B: AsRef<[u8]>, HM: HeaderMetadata + HeaderMetadataMut,