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.

Reads raw data from the io buffer into a raw kernel buffer.

Safety

The output buffer must be valid.

Provided Methods

Returns true if no data is available in the io buffer.

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.

Reads the contents of a plain old data (POD) type from the io buffer.

Implementors

This documentation is an old archive. Please see https://rust.docs.kernel.org instead.