Struct exar::TabSeparatedParser
[−]
[src]
pub struct TabSeparatedParser<'a> { // some fields omitted }
A parser for tab-separated strings
Examples
#[macro_use] extern crate exar; use exar::*; let tab_separated_value = tab_separated!("hello", "world"); let mut parser = TabSeparatedParser::new(2, &tab_separated_value); let hello: String = parser.parse_next().unwrap(); let world: String = parser.parse_next().unwrap();
Methods
impl<'a> TabSeparatedParser<'a>
[src]
fn new(n: usize, s: &'a str) -> TabSeparatedParser<'a>
Creates a new parser that splits a string up to n
parts.
fn parse_next<T>(&mut self) -> Result<T, ParseError> where T: FromStr, T::Err: Display + Debug
Parses the next string slice into the given type T
and returns it,
or returns a ParseError
if a failure occurs while parsing the value.