Expand description
Various combinators which do not fit anywhere else.
Structs§
- AndThen
- AnyPartial
State - AnyPartial
State Parser - AnySend
Partial State - AnySend
Partial State Parser - AnySend
Sync Partial State - AnySend
Sync Partial State Parser - Factory
- FlatMap
- FromStr
- Ignore
- Input
Converter - Lazy
- Look
Ahead - Map
- MapInput
- NoPartial
- NotFollowed
By - Opaque
- Recognize
- Spanned
- Try
Enums§
Traits§
Functions§
- and_
then - Equivalent to
p.and_then(f)
. - any_
partial_ state - Returns a parser where
P::PartialState
is boxed. Useful as a way to avoid writing the type since it can get very large after combining a few parsers. - any_
send_ partial_ state - Returns a parser where
P::PartialState
is boxed. Useful as a way to avoid writing the type since it can get very large after combining a few parsers. - any_
send_ sync_ partial_ state - Returns a parser where
P::PartialState
is boxed. Useful as a way to avoid writing the type since it can get very large after combining a few parsers. - attempt
attempt(p)
behaves asp
except it always acts asp
peeked instead of committed on its parse.- factory
- Constructs the parser lazily on each
parse_*
call. This is similar tolazy
but it takesInput
as an argument and allows different parsers to be returned on each call top
while still reporting the correct errors. - flat_
map - Equivalent to
p.flat_map(f)
. - from_
str - Takes a parser that outputs a string like value (
&str
,String
,&[u8]
orVec<u8>
) and parses it usingstd::str::FromStr
. Errors if the output ofparser
is not UTF-8 or ifFromStr::from_str
returns an error. - input_
converter - lazy
- Constructs the parser lazily on each
parse_*
call. Can be used to effectively reduce the size of deeply nested parsers as only the function producing the parser is stored. - look_
ahead look_ahead(p)
acts asp
but doesn’t consume input on success.- map
- Equivalent to
p.map(f)
. - map_
input - Equivalent to
p.map_input(f)
. - no_
partial - not_
followed_ by - Succeeds only if
parser
fails. Never consumes any input. - opaque
- Creates a parser from a function which takes a function that are given the actual parser.
Though convoluted this makes it possible to hide the concrete parser type without
Box
or losing the full information about the parser as is the case ofparser
. - recognize
- Constructs a parser which returns the tokens parsed by
parser
accumulated inF: Extend<Input::Token>
instead ofP::Output
. - spanned
- Equivalent to
p.spanned()
.
Type Aliases§
- FnOpaque
- Alias over
Opaque
where the function can be a plain function pointer (does not need to capture any values)