[][src]Enum genio::ext::ReadResult

pub enum ReadResult<'a> {
    Bytes(&'a mut [u8]),
    End,
}

Result of successful read operation.

Variants

Bytes(&'a mut [u8])

Some bytes were read. The slice will always contain at least one byte.

End

No bytes available (End reached).

Methods

impl<'a> ReadResult<'a>[src]

pub fn require_bytes<T>(self) -> Result<&'a mut [u8], ReadExactError<T>>[src]

Helps mapping ReadResult to ReadExactError

Example

Assuming a function returns ReadExactError<T>

let bytes = reader.read_ext(&mut buf)?.require_bytes()?;

Auto Trait Implementations

impl<'a> Send for ReadResult<'a>

impl<'a> Sync for ReadResult<'a>

Blanket Implementations

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> From for T[src]

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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