[][src]Enum lber::IResult

pub enum IResult<I, O, E = u32> {
    Done(I, O),
    Error(ErrorKind<E>),
    Incomplete(Needed),
}

Holds the result of parsing functions

It depends on I, the input type, O, the output type, and E, the error type (by default u32)

Variants

Done(I, O)

indicates a correct parsing, the first field containing the rest of the unparsed data, the second field contains the parsed data

Error(ErrorKind<E>)

contains a Err, an enum that can indicate an error code, a position in the input, and a pointer to another error, making a list of errors in the parsing tree

Incomplete(Needed)

Incomplete contains a Needed, an enum than can represent a known quantity of input data, or unknown

Methods

impl<I, O, E> IResult<I, O, E>[src]

pub fn map_err<N, F>(self, f: F) -> IResult<I, O, N> where
    F: FnOnce(ErrorKind<E>) -> ErrorKind<N>, 
[src]

Maps a IResult<I, O, E> to IResult<I, O, N> by appling a function to a contained Error value, leaving Done and Incomplete value untouched.

pub fn unwrap_err(self) -> ErrorKind<E>[src]

Unwrap the contained Error(E) value, or panic if the IResult is not Error.

pub fn to_full_result(self) -> Result<O, IError<E>>[src]

Convert the IResult to a std::result::Result

pub fn to_result(self) -> Result<O, ErrorKind<E>>[src]

Convert the IResult to a std::result::Result, or panic if the IResult is Incomplete

impl<I, O, E> IResult<I, O, E>[src]

pub fn is_done(&self) -> bool[src]

pub fn is_err(&self) -> bool[src]

pub fn is_incomplete(&self) -> bool[src]

pub fn or(self, other: IResult<I, O, E>) -> IResult<I, O, E>[src]

pub fn map<N, F>(self, f: F) -> IResult<I, N, E> where
    F: FnOnce(O) -> N, 
[src]

Maps a IResult<I, O, E> to IResult<I, N, E> by appling a function to a contained Done value, leaving Error and Incomplete value untouched.

pub fn map_inc<F>(self, f: F) -> IResult<I, O, E> where
    F: FnOnce(Needed) -> Needed
[src]

Maps a IResult<I, O, E> to IResult<I, O, E> by appling a function to a contained Incomplete value, leaving Done and Error value untouched.

pub fn unwrap(self) -> (I, O)[src]

Unwrap the contained Done(I, O) value, or panic if the IResult is not Done.

pub fn unwrap_inc(self) -> Needed[src]

Unwrap the contained Incomplete(n) value, or panic if the IResult is not Incomplete.

Trait Implementations

impl<I, O, E> Clone for IResult<I, O, E> where
    E: Clone,
    I: Clone,
    O: Clone
[src]

impl<I, O, E> Debug for IResult<I, O, E> where
    E: Debug,
    I: Debug,
    O: Debug
[src]

impl<I, O, E> Eq for IResult<I, O, E> where
    E: Eq,
    I: Eq,
    O: Eq
[src]

impl<'a, I, O, E> GetInput<&'a [I]> for IResult<&'a [I], O, E>[src]

impl<'a, O, E> GetInput<&'a str> for IResult<&'a str, O, E>[src]

impl<O, E> GetInput<()> for IResult<(), O, E>[src]

impl<'a, I, O, E> GetOutput<&'a [O]> for IResult<I, &'a [O], E>[src]

impl<'a, I, E> GetOutput<&'a str> for IResult<I, &'a str, E>[src]

impl<I, E> GetOutput<()> for IResult<I, (), E>[src]

impl<I, O, E> PartialEq<IResult<I, O, E>> for IResult<I, O, E> where
    E: PartialEq<E>,
    I: PartialEq<I>,
    O: PartialEq<O>, 
[src]

impl<I, O, E> StructuralEq for IResult<I, O, E>[src]

impl<I, O, E> StructuralPartialEq for IResult<I, O, E>[src]

Auto Trait Implementations

impl<I, O, E> RefUnwindSafe for IResult<I, O, E> where
    E: RefUnwindSafe,
    I: RefUnwindSafe,
    O: RefUnwindSafe

impl<I, O, E> Send for IResult<I, O, E> where
    E: Send,
    I: Send,
    O: Send

impl<I, O, E> Sync for IResult<I, O, E> where
    E: Sync,
    I: Sync,
    O: Sync

impl<I, O, E> Unpin for IResult<I, O, E> where
    E: Unpin,
    I: Unpin,
    O: Unpin

impl<I, O, E> UnwindSafe for IResult<I, O, E> where
    E: UnwindSafe,
    I: UnwindSafe,
    O: UnwindSafe

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