pub struct SpacesParser {}Expand description
Parses for at least one and as many spaces as possible
§Example
use microparsec::{ParserRc, SpacesParser, StringParser, SequenceParser, StringParserT, ContextParserT, parsers};
let hello_parser = StringParser::new("Hello");
let spaces_parser = SpacesParser::new();
let world_parser = StringParser::new("World");
let res = SequenceParser::new(parsers!(hello_parser, spaces_parser, world_parser)).parse("Hello World");
assert_eq!(
res.unwrap().val,
vec!["Hello".to_string(), " ".to_string(), "World".to_string()]
);Implementations§
Source§impl SpacesParser
impl SpacesParser
Trait Implementations§
Source§impl Clone for SpacesParser
impl Clone for SpacesParser
Source§impl ContextParserT<String> for SpacesParser
impl ContextParserT<String> for SpacesParser
Source§fn get_generic_error_message(&self) -> String
fn get_generic_error_message(&self) -> String
Returns a generic error message of the parser that is configured at initialization and
independent of the runtime result of the attempted parse
Source§fn get_parser_type(&self) -> ParserType
fn get_parser_type(&self) -> ParserType
Returns the
ParserType of the parser (used for stack traces and error messages)Auto Trait Implementations§
impl Freeze for SpacesParser
impl RefUnwindSafe for SpacesParser
impl Send for SpacesParser
impl Sync for SpacesParser
impl Unpin for SpacesParser
impl UnsafeUnpin for SpacesParser
impl UnwindSafe for SpacesParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more