Crate binator_core

Source
Expand description

Terminology:

NameDescription
StreamA structure that would produce Item when asked
ParserSomething that will check that Item produced by Stream are correct
ContextA structure that will manage Failure from Parser
TokenRepresent what a Parser return for Success
AtomA structure that contain information about the Failure or Error from a Parser
ElementSomething, generally an enumeration, that will contain all different kind of Atom
ParsedEnumeration that indicate result of a Parser
ParseA trait that all Parser implement, used to use a Parser
FailureIndicate a Parser didn’t validate the input
SuccessIndicate a Parser validate the input
ErrorIndicate a Parser encounter an irrecoverable error.
StreamingA trait that Stream implement to make their job
ItemItem produced by a Stream, generally just an u8
SpanA delimited part of the Stream
ContextingA trait that all Context will implement, used to accumulate failure of Parser

Structs§

Success
This represent a stand alone Success from Parsed result.

Enums§

CoreAtom
Core context used to implement context for basic type like u8
Parsed
Parsed represent the result of a parse().
ParsedAux
This is like Parsed but Succeed doesn’t contain stream
Split
Represent split Result

Traits§

Acc
This is very usefull to be use on combinator like fold. For example, .fold_bounds(.., Vec::new, Acc::acc).
Contexting
Contexting is a trait used to report failure and error. This idea is too have a tree of context that will help final user to understand the error. It’s can also help for debugging purpose.
Extend
Abstracts something which can extend an &mut self.
Parse
Parse is a trait that all parsers should implement. There is a blanked implementation for type that implement FnMut that match signature of parse(). This mean you can quickly use a function to implement a Parser.
ProvideElement
This is an utily trait
Push
Abstracts something which can push Item into self
Streaming
This trait must be implement by all struct that want to be a stream for binator.
TryAcc
This is very usefull to be use on combinator like try_fold. For example, .try_fold_bounds(.., || Ok(Vec::new), TryAcc::try_acc).
TryExtend
Abstracts something which can try extend &mut self.
TryPush
Abstracts something you can try push item into &mut self