[−][src]Trait buf_min::Buffer
Minimal Buffer trait
Associated Types
type Freeze
Into immutable type
Required methods
fn with_capacity(capacity: usize) -> Self where
Self: Sized,
Self: Sized,
Returns new Buffer
with capacity
fn extend_from_slice(&mut self, src: &[u8])
Appends given bytes to this Buffer
.
Panics
Can panic if current length plus src
length overflows usize
fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional
more bytes to be inserted
into the given Buffer
.
Panics
Can panic if current capacity plus additional
overflows usize
fn freeze(self) -> Self::Freeze
Converts self
into a Freeze type
unsafe fn advance(&mut self, cnt: usize)
Advance the internal cursor of the Buffer
Safety
Can't advance more than capacity of the Buffer
Panics
Can panic if length plus cnt
is bigger than capacity
unsafe fn buf_ptr(&mut self) -> *mut u8
Implementations on Foreign Types
impl Buffer for BytesMut
[src]
type Freeze = Bytes
fn with_capacity(capacity: usize) -> Self where
Self: Sized,
[src]
Self: Sized,