# Enum synom::IResult [−] [src]

    pub enum IResult<I, O> {
        Done(I, O),
        Error,
    }

The result of a parser.

## Variants

`Done(I, O)`

Parsing succeeded. The first field contains the rest of the unparsed data and the second field contains the parse result.

`Error`

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: Debug, O: Debug> Debug for IResult<I, O>`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`
[src]

Formats the value using the given formatter. Read more

### `impl<I: PartialEq, O: PartialEq> PartialEq for IResult<I, O>`
[src]

#### `fn eq(&self, __arg_0: &IResult<I, O>) -> bool`
[src]

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, __arg_0: &IResult<I, O>) -> bool`
[src]

This method tests for `!=`.

### `impl<I: Eq, O: Eq> Eq for IResult<I, O>`
[src]

### `impl<I: Clone, O: Clone> Clone for IResult<I, O>`
[src]

#### `fn clone(&self) -> IResult<I, O>`
[src]

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`
1.0.0
[src]

Performs copy-assignment from `source`. Read more

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)