pub struct IOBuf { /* private fields */ }
Expand description
Represents an IO buffer (data handed to/from device).
Implementations§
source§impl IOBuf
impl IOBuf
pub fn new(layout: Layout) -> Result<IOBuf, IOMemError>
pub fn truncate(&mut self, new_len: usize)
sourcepub fn copy_in_at(
&mut self,
offset: usize,
src: &[u8]
) -> Result<usize, IOMemError>
pub fn copy_in_at( &mut self, offset: usize, src: &[u8] ) -> Result<usize, IOMemError>
Copy data from src
into a given offset
of the IOBuf
.
sourcepub fn copy_in(&mut self, src: &[u8]) -> Result<usize, IOMemError>
pub fn copy_in(&mut self, src: &[u8]) -> Result<usize, IOMemError>
Copy raw data of size len
into the buffer.
sourcepub fn copy_out_at(
&self,
offset: usize,
dst: &mut [u8]
) -> Result<usize, IOMemError>
pub fn copy_out_at( &self, offset: usize, dst: &mut [u8] ) -> Result<usize, IOMemError>
Copy data out of the IOBuf, starting at a given offset
into dst
.
sourcepub fn copy_out(&self, dst: &mut [u8]) -> Result<usize, IOMemError>
pub fn copy_out(&self, dst: &mut [u8]) -> Result<usize, IOMemError>
Copy the data (starting at 0) to dst
slice.
sourcepub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Get a IOBuf contents as mutable slice.