[−][src]Enum synom::IResult
The result of a parser.
Variants
Parsing succeeded. The first field contains the rest of the unparsed data and the second field contains the parse result.
Parsing failed.
Methods
impl<'a, O> IResult<&'a str, O>
[src]
pub fn expect(self, name: &str) -> O
[src]
Unwraps the result, asserting the the parse is complete. Panics with a message based on the given string if the parse failed or is incomplete.
extern crate syn; #[macro_use] extern crate synom; use syn::Ty; use syn::parse::ty; // One or more Rust types separated by commas. named!(comma_separated_types -> Vec<Ty>, separated_nonempty_list!(punct!(","), ty) ); fn main() { let input = "&str, Map<K, V>, String"; let parsed = comma_separated_types(input).expect("comma-separated types"); assert_eq!(parsed.len(), 3); println!("{:?}", parsed); }
Trait Implementations
impl<I: Eq, O: Eq> Eq for IResult<I, O>
[src]
impl<I: Clone, O: Clone> Clone for IResult<I, O>
[src]
impl<I: PartialEq, O: PartialEq> PartialEq<IResult<I, O>> for IResult<I, O>
[src]
impl<I: Debug, O: Debug> Debug for IResult<I, O>
[src]
Auto Trait Implementations
impl<I, O> Send for IResult<I, O> where
I: Send,
O: Send,
I: Send,
O: Send,
impl<I, O> Unpin for IResult<I, O> where
I: Unpin,
O: Unpin,
I: Unpin,
O: Unpin,
impl<I, O> Sync for IResult<I, O> where
I: Sync,
O: Sync,
I: Sync,
O: Sync,
impl<I, O> UnwindSafe for IResult<I, O> where
I: UnwindSafe,
O: UnwindSafe,
I: UnwindSafe,
O: UnwindSafe,
impl<I, O> RefUnwindSafe for IResult<I, O> where
I: RefUnwindSafe,
O: RefUnwindSafe,
I: RefUnwindSafe,
O: RefUnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,