[−][src]Trait buf_min::Buffer
Minimal Buffer trait
Associated Types
Loading content...Required methods
pub fn with_capacity(capacity: usize) -> Self where
Self: Sized, [src]
Self: Sized,
Returns new Buffer with capacity
pub fn is_empty(&self) -> bool[src]
Returns true if the Buffer has a length of 0.
pub fn extend_from_slice(&mut self, src: &[u8])[src]
Appends given bytes to this Buffer.
Panics
Can panic if current length plus src length overflows usize
pub fn reserve(&mut self, additional: usize)[src]
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
pub fn freeze(self) -> Self::Freeze[src]
Converts self into a Freeze type
pub unsafe fn advance(&mut self, cnt: usize)[src]
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
pub unsafe fn buf_ptr(&mut self) -> *mut u8[src]
Implementations on Foreign Types
impl Buffer for Vec<u8>[src]
type Freeze = Vec<u8>
pub fn with_capacity(capacity: usize) -> Self where
Self: Sized, [src]
Self: Sized,
pub fn is_empty(&self) -> bool[src]
pub fn extend_from_slice(&mut self, src: &[u8])[src]
pub fn reserve(&mut self, additional: usize)[src]
pub fn freeze(self) -> Self::Freeze[src]
pub unsafe fn advance(&mut self, cnt: usize)[src]
pub unsafe fn buf_ptr(&mut self) -> *mut u8[src]
Implementors
impl Buffer for BytesMut[src]
type Freeze = Bytes
pub fn with_capacity(capacity: usize) -> Self where
Self: Sized, [src]
Self: Sized,