Trait anchor::InputBuffer

source ·
pub trait InputBuffer {
    // Required methods
    fn data(&self) -> &[u8] ;
    fn pop(&mut self, count: usize);

    // Provided method
    fn available(&self) -> usize { ... }
}
Expand description

Trait representing a buffer that protocol messages can be read from

Required Methods§

source

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

Retrieve all current data in the buffer

source

fn pop(&mut self, count: usize)

Remove count bytes from the front of the buffer

Provided Methods§

source

fn available(&self) -> usize

Retrieve the amount of data currently in the buffer

Implementations on Foreign Types§

source§

impl InputBuffer for Vec<u8>

source§

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

source§

fn pop(&mut self, count: usize)

source§

fn available(&self) -> usize

Implementors§