Crate binator_base

Source
Expand description

Contains a lot of useful binator parser.

Structs§

Alpha
Alpha
AlphaNum
AlphaNum
Bit
Bit
Char
Char
Cr
Cr
CrLf
CrLf
CrLfRelaxed
CrLfRelaxed
Ctl
Ctl
DQuote
DQuote
Digit
Digit
EndOfStreamAtom
Context from end_of_stream parser.
HTab
HTab
HexDig
HexDig
LWsp
LWsp
Lf
Lf
NBit
Used by nbit to represent n only if 0 > n > 8
Sp
Sp
VChar
VChar
Wsp
Wsp

Enums§

BaseAtom
Atom for base combinator

Functions§

all
Parser that will consume all data from stream.
alpha
ALPHA = A - Z / a - z
alphanum
ALPHANUM = A - Z / a - z / 0 - 9
any
This will return any item in the stream, that equivalent to .next() from iterator. This can be used in many combinator that the root of all others base combinator. any will take care of end of stream and stream error.
bit
BIT = 0 / 1
char
CHAR = 0x01 - 0x7F
cr
CR = \r
crlf
Internet standard newline
crlf_relaxed
Newline, with and without “\r”.
ctl
CTL = 0x00 - 0x1F / 0x7F
digit
DIGIT = 0-9
dquote
DQUOTE = “
end_of_stream
Return Success if the stream return end of stream.
failure
Always return a Failure
hexdig
HEXDIG = DIGIT / A - F / a - f
htab
HTAB = \t
is
Return Success if item from stream is partially equal to t.
is_not
Return Success if item from stream is not partially equal to t.
lf
LF = \n
list
Take a list of T and return a Parser that will partially Eq in order Item produced by Stream with T in the list
lwsp
Use of this linear-white-space rule permits lines containing only white space that are no longer legal in mail headers and have caused interoperability problems in other contexts.
nbit
Return a Parser that will split an octet in two into a tuple of octet. For n = 3, 0b11000011u8 will give (0b00011000u8, 0b00000011u8)
none_of
Will check if next Item from Stream is not partially equal to one of T in the list.
octet
Will read an item from the Stream and convert it to an octet
one_of
Will check if next Item from Stream is partially equal to one of T in the list.
parse
Take a parser and return a Parser that will call parse on it.
sp
SP = ’ ’
success
Take a token in parameter and return a Parser that don’t read the Stream and always return Success by Cloning the token.
tag
Take a &’static str and return a Parser that will compare it with Stream, this requiere the Stream Span to implement AsRef<[u8]>
tag_no_case
Take a &’static str and return a Parser that will compare it without the ascii case with Stream, this requiere the Stream Span to implement AsRef<[u8]>
take
Return n number of items from stream in a Span
utf8
Parser that will read stream and return valid utf8 char If you are expecting utf8 you MUST use this Parser, and not character Parser.
vchar
VCHAR = ! - ~
wsp
WSP = SP / HTAB

Trait Aliases§

AsciiParse
Meta trait for ascii combinator