Trait askar_crypto::buffer::ResizeBuffer [−][src]
pub trait ResizeBuffer: WriteBuffer + AsRef<[u8]> + AsMut<[u8]> { fn buffer_insert(&mut self, pos: usize, data: &[u8]) -> Result<(), Error>; fn buffer_remove(&mut self, range: Range<usize>) -> Result<(), Error>; fn buffer_resize(&mut self, len: usize) -> Result<(), Error>; fn buffer_extend(&mut self, len: usize) -> Result<&mut [u8], Error> { ... } }
Expand description
Support for writing to, accessing, and resizing a byte buffer
Required methods
fn buffer_insert(&mut self, pos: usize, data: &[u8]) -> Result<(), Error>
[src]
Expand description
Insert a slice at the given position in the buffer
fn buffer_remove(&mut self, range: Range<usize>) -> Result<(), Error>
[src]
Expand description
Remove an exclusive range from the buffer
fn buffer_resize(&mut self, len: usize) -> Result<(), Error>
[src]
Expand description
Resize the buffer, truncating or padding it with zeroes
Provided methods
fn buffer_extend(&mut self, len: usize) -> Result<&mut [u8], Error>
[src]
Expand description
Extend the buffer with len
bytes of zeroes and return
a mutable reference to the slice
Implementations on Foreign Types
impl ResizeBuffer for Vec<u8>
[src]
impl ResizeBuffer for Vec<u8>
[src]This is supported on crate feature
alloc
only.Implementors
impl ResizeBuffer for SecretBytes
[src]
impl ResizeBuffer for SecretBytes
[src]