pub trait Separator {
    // Required methods
    fn separator() -> &'static str;
    fn parse<'i, 't, F, T, E>(
        parser: &mut Parser<'i, 't>,
        parse_one: F
    ) -> Result<Vec<T>, ParseError<'i, E>>
       where F: for<'tt> FnMut(&mut Parser<'i, 'tt>) -> Result<T, ParseError<'i, E>>;
}
Expand description

A trait satisfied by the types corresponding to separators.

Required Methods§

source

fn separator() -> &'static str

The separator string that the satisfying separator type corresponds to.

source

fn parse<'i, 't, F, T, E>( parser: &mut Parser<'i, 't>, parse_one: F ) -> Result<Vec<T>, ParseError<'i, E>>where F: for<'tt> FnMut(&mut Parser<'i, 'tt>) -> Result<T, ParseError<'i, E>>,

Parses a sequence of values separated by this separator.

The given closure is called repeatedly for each item in the sequence.

Successful results are accumulated in a vector.

This method returns Err(_) the first time a closure does or if the separators aren’t correct.

Implementors§