Trait buf_min::Buffer [−][src]
pub trait Buffer { type Freeze; fn with_capacity(capacity: usize) -> Self
where
Self: Sized; fn is_empty(&self) -> bool; fn len(&self) -> usize; unsafe fn extend_from_slice(&mut self, src: &[u8]); fn reserve(&mut self, additional: usize); fn freeze(self) -> Self::Freeze; unsafe fn advance(&mut self, cnt: usize); unsafe fn buf_ptr(&mut self) -> *mut u8; fn extend(&mut self, src: &str) { ... } }
Expand description
Minimal Buffer trait with utf-8 safety
Associated Types
Required methods
fn with_capacity(capacity: usize) -> Self where
Self: Sized,
fn with_capacity(capacity: usize) -> Self where
Self: Sized,
Returns new Buffer
with capacity
unsafe fn extend_from_slice(&mut self, src: &[u8])
unsafe fn extend_from_slice(&mut self, src: &[u8])
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