pub struct DataBuffer(/* private fields */);Implementations§
Source§impl DataBuffer
impl DataBuffer
pub fn new(data: &[u8]) -> Self
pub fn get_data(&self) -> &[u8] ⓘ
pub fn get_data_at(&self, offset: usize) -> &[u8] ⓘ
Sourcepub fn get_slice(&self, start: usize, len: usize) -> Option<Self>
pub fn get_slice(&self, start: usize, len: usize) -> Option<Self>
Create a copy of a especified part of the data
Sourcepub unsafe fn set_len(&mut self, len: usize)
pub unsafe fn set_len(&mut self, len: usize)
change the size of the allocated data, if new size is bigger data is need to be initialized
Sourcepub fn append_data(&self, data: &[u8])
pub fn append_data(&self, data: &[u8])
concat the contents of data into self
Sourcepub unsafe fn set_byte_at(&mut self, offset: usize, byte: u8)
pub unsafe fn set_byte_at(&mut self, offset: usize, byte: u8)
Set the value of the byte at offset