[][src]Struct glommio::io::ReadResult

pub struct ReadResult { /* fields omitted */ }

ReadResult encapsulates a buffer, returned by read operations like get_buffer_aligned and read_dma

Implementations

impl ReadResult[src]

pub fn read_at(&self, offset: usize, dst: &mut [u8]) -> usize[src]

Copies the contents of this ReadResult into the byte-slice dst.

The copy starts at position offset into the ReadResult and copies as many bytes as possible until either we don't have more bytes to copy or dst doesn't have more space to hold them.

pub fn slice(&self, extra_offset: usize, len: usize) -> Result<ReadResult>[src]

Creates a slice of this ReadResult with the given offset and length.

Returns an std::io::Error with [std::io::ErrorKind] [InvalidInput] if either offset or offset + len would not fit in the original buffer.

pub fn len(&self) -> usize[src]

The length of this buffer

pub fn as_bytes(&self) -> &[u8][src]

Allows accessing the contents of this buffer as a byte slice

Trait Implementations

impl Clone for ReadResult[src]

impl Debug for ReadResult[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.