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
Returns the number of bytes left to be read from the io buffer.
Note that even reading less than this number of bytes may fail.
Provided Methods
Reads all data remaining in the io buffer.
Returns EFAULT
if the address does not currently point to mapped, readable memory.
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.
fn 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.