[−][src]Trait v_escape::Buffer
Minimal Buffer trait
Associated Types
Loading content...Required methods
pub fn with_capacity(capacity: usize) -> Self
[src]
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, Global>
[src]
type Freeze = Vec<u8, Global>
pub fn with_capacity(capacity: usize) -> Vec<u8, Global> where
Vec<u8, Global>: Sized,
[src]
Vec<u8, Global>: 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) -> <Vec<u8, Global> as Buffer>::Freeze
[src]
pub unsafe fn advance(&mut self, cnt: usize)
[src]
pub unsafe fn buf_ptr(&mut self) -> *mut u8
[src]
impl Buffer for BytesMut
[src]
type Freeze = Bytes
pub fn with_capacity(capacity: usize) -> BytesMut where
BytesMut: Sized,
[src]
BytesMut: Sized,