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

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

Result of successful read operation.

Variants

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> RefUnwindSafe for ReadResult<'a>

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

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

impl<'a> Unpin for ReadResult<'a>

impl<'a> !UnwindSafe for ReadResult<'a>

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, 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.