Trait amq_protocol::frame::BackToTheBuffer

source ·
pub trait BackToTheBuffer: Write {
    // Required method
    fn reserve_write_use<Tmp, Gen, Before>(
        s: WriteContext<Self>,
        reserved: usize,
        gen: &Gen,
        before: &Before
    ) -> Result<WriteContext<Self>, GenError>
       where Gen: Fn(WriteContext<Self>) -> Result<(WriteContext<Self>, Tmp), GenError>,
             Before: Fn(WriteContext<Self>, Tmp) -> Result<WriteContext<Self>, GenError>,
             Self: Sized;
}
Expand description

Trait for Write types that allow skipping and reserving a slice, then writing some data, then write something in the slice we reserved using the return for our data write.

Required Methods§

source

fn reserve_write_use<Tmp, Gen, Before>( s: WriteContext<Self>, reserved: usize, gen: &Gen, before: &Before ) -> Result<WriteContext<Self>, GenError>
where Gen: Fn(WriteContext<Self>) -> Result<(WriteContext<Self>, Tmp), GenError>, Before: Fn(WriteContext<Self>, Tmp) -> Result<WriteContext<Self>, GenError>, Self: Sized,

Implementations on Foreign Types§

source§

impl BackToTheBuffer for &mut [u8]

source§

fn reserve_write_use<Tmp, Gen, Before>( s: WriteContext<&mut [u8]>, reserved: usize, gen: &Gen, before: &Before ) -> Result<WriteContext<&mut [u8]>, GenError>
where Gen: Fn(WriteContext<&mut [u8]>) -> Result<(WriteContext<&mut [u8]>, Tmp), GenError>, Before: Fn(WriteContext<&mut [u8]>, Tmp) -> Result<WriteContext<&mut [u8]>, GenError>,

source§

impl BackToTheBuffer for Vec<u8>

source§

fn reserve_write_use<Tmp, Gen, Before>( s: WriteContext<Vec<u8>>, reserved: usize, gen: &Gen, before: &Before ) -> Result<WriteContext<Vec<u8>>, GenError>
where Gen: Fn(WriteContext<Vec<u8>>) -> Result<(WriteContext<Vec<u8>>, Tmp), GenError>, Before: Fn(WriteContext<Vec<u8>>, Tmp) -> Result<WriteContext<Vec<u8>>, GenError>,

Implementors§

source§

impl<W> BackToTheBuffer for W
where W: Seek,