[−][src]Enum nom::IResult
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(Err<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]
[−]
impl<I, O, E> IResult<I, O, E>
pub fn map_err<N, F>(self, f: F) -> IResult<I, O, N> where
F: FnOnce(Err<E>) -> Err<N>,
[src]
[−]
pub fn map_err<N, F>(self, f: F) -> IResult<I, O, N> where
F: FnOnce(Err<E>) -> Err<N>,
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) -> Err<E>
[src]
[−]
pub fn unwrap_err(self) -> Err<E>
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]
[−]
pub fn to_full_result(self) -> Result<O, IError<E>>
Convert the IResult to a std::result::Result
pub fn to_result(self) -> Result<O, Err<E>>
[src]
[−]
pub fn to_result(self) -> Result<O, Err<E>>
Convert the IResult to a std::result::Result, or panic if the IResult
is Incomplete
impl<I, O, E> IResult<I, O, E>
[src]
[−]
impl<I, O, E> IResult<I, O, E>
pub fn is_done(&self) -> bool
[src]
pub fn is_done(&self) -> bool
pub fn is_err(&self) -> bool
[src]
pub fn is_err(&self) -> bool
pub fn is_incomplete(&self) -> bool
[src]
pub fn is_incomplete(&self) -> bool
pub fn or(self, other: IResult<I, O, E>) -> IResult<I, O, E>
[src]
pub fn or(self, other: IResult<I, O, E>) -> IResult<I, O, E>
pub fn map<N, F: FnOnce(O) -> N>(self, f: F) -> IResult<I, N, E>
[src]
[−]
pub fn map<N, F: FnOnce(O) -> N>(self, f: F) -> IResult<I, N, E>
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]
[−]
pub fn map_inc<F>(self, f: F) -> IResult<I, O, E> where
F: FnOnce(Needed) -> Needed,
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]
[−]
pub fn unwrap(self) -> (I, O)
Unwrap the contained Done(I, O)
value, or panic if the IResult
is not
Done
.
pub fn unwrap_or(self, default: (I, O)) -> (I, O)
[src]
[−]
pub fn unwrap_or(self, default: (I, O)) -> (I, O)
Unwrap the contained Done(I, O)
value or a default if the IResult
is not
Done
.
pub fn unwrap_inc(self) -> Needed
[src]
[−]
pub fn unwrap_inc(self) -> Needed
Unwrap the contained Incomplete(n)
value, or panic if the IResult
is not
Incomplete
.
Trait Implementations
impl<'a, I, O, E> GetInput<&'a [I]> for IResult<&'a [I], O, E>
[src]
[+]
impl<'a, I, O, E> GetInput<&'a [I]> for IResult<&'a [I], O, E>
impl<O, E> GetInput<()> for IResult<(), O, E>
[src]
[+]
impl<O, E> GetInput<()> for IResult<(), O, E>
impl<'a, O, E> GetInput<&'a str> for IResult<&'a str, O, E>
[src]
[+]
impl<'a, O, E> GetInput<&'a str> for IResult<&'a str, O, E>
impl<'a, I, O, E> GetOutput<&'a [O]> for IResult<I, &'a [O], E>
[src]
[+]
impl<'a, I, O, E> GetOutput<&'a [O]> for IResult<I, &'a [O], E>
impl<I, E> GetOutput<()> for IResult<I, (), E>
[src]
[+]
impl<I, E> GetOutput<()> for IResult<I, (), E>
impl<'a, I, E> GetOutput<&'a str> for IResult<I, &'a str, E>
[src]
[+]
impl<'a, I, E> GetOutput<&'a str> for IResult<I, &'a str, E>
impl<I: Clone, O: Clone, E: Clone> Clone for IResult<I, O, E>
[src]
[+]
impl<I: Clone, O: Clone, E: Clone> Clone for IResult<I, O, E>
impl<I: Eq, O: Eq, E: Eq> Eq for IResult<I, O, E>
[src]
impl<I: Eq, O: Eq, E: Eq> Eq for IResult<I, O, E>
impl<I: PartialEq, O: PartialEq, E: PartialEq> PartialEq<IResult<I, O, E>> for IResult<I, O, E>
[src]
[+]
impl<I: PartialEq, O: PartialEq, E: PartialEq> PartialEq<IResult<I, O, E>> for IResult<I, O, E>
impl<I: Debug, O: Debug, E: Debug> Debug for IResult<I, O, E>
[src]
[+]
impl<I: Debug, O: Debug, E: Debug> Debug for IResult<I, O, E>
Auto Trait Implementations
impl<I, O, E> Send for IResult<I, O, E> where
E: Send,
I: Send,
O: Send,
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> Sync for IResult<I, O, E> where
E: Sync,
I: Sync,
O: Sync,
Blanket Implementations
impl<T> From for T
[src]
[−]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
[−]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
[−]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
[−]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
[−]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom for T where
T: From<U>,
[src]
[−]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
[−]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
[−]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
[−]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
[−]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> BorrowMut for T where
T: ?Sized,
[src]
[−]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
[−]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
[−]
impl<T, U> TryInto for T where
U: TryFrom<T>,