Crate parser_compose
source ·Expand description
See the README.md for the introduction and examples
Parsers
Any rust item that implements the Parser
trait can parse input by
calling try_parse()
Strings and slices implement the Parser
trait:
Additionally the Parser
trait is implemented for all functions with the following
signature.
Lastly, a few utility parsers are provided:
Parser combinators
The associated methods on the Parser
trait are used to combine parsers.
The sequence combinator is so common that it has a special form. Tuples of parsers implement
Parser
such that the tuple parser succeeds if all its parsers succeed.
Errors
parser-compose
take a simple approach to error handling: If a parser fails, it returns None
Structs
- See
and_then()
- See
byte
- See
fold()
- See
map()
. - See
optional()
- See
or()
- See
peek()
- See
when()
- See
utf8_scalar
Traits
- A trait for parsers
- Trait used to specify how many times a parser should run.
Functions
- Returns a parser that recognizes the first byte in a slice if its value is in the specified range.
- A parser that recognizes the first item in a slice.
- A parser that recognizes the first unicode scalar value at the start of a string slice.
- Returns a parser that recognizes the first unicode scalar value in a string slice if its value is in the specified range