Trait kernel::io_buffer::IoBufferReader
source · [−]pub trait IoBufferReader {
fn len(&self) -> usize;
unsafe fn read_raw(&mut self, out: *mut u8, len: usize) -> Result;
fn is_empty(&self) -> bool { ... }
fn read_all(&mut self) -> Result<Vec<u8>> { ... }
fn read_slice(&mut self, data: &mut [u8]) -> Result { ... }
fn read<T: ReadableFromBytes>(&mut self) -> Result<T> { ... }
}
Expand description
Represents a buffer to be read from during IO.
Required Methods
Provided Methods
sourcefn read_all(&mut self) -> Result<Vec<u8>>
fn read_all(&mut self) -> Result<Vec<u8>>
Reads all data remaining in the io buffer.
Returns EFAULT
if the address does not currently point to mapped, readable memory.
sourcefn read_slice(&mut self, data: &mut [u8]) -> Result
fn read_slice(&mut self, data: &mut [u8]) -> Result
Reads a byte slice from the io buffer.
Returns EFAULT
if the byte slice is bigger than the remaining size of the user slice or
if the address does not currently point to mapped, readable memory.
sourcefn read<T: ReadableFromBytes>(&mut self) -> Result<T>
fn read<T: ReadableFromBytes>(&mut self) -> Result<T>
Reads the contents of a plain old data (POD) type from the io buffer.