Expand description
Minimal parser combinators
Basic parsers
Items | Description | Example |
---|---|---|
and | Combine two parsers where both must succeed. | and(u16l, u32l) |
or | Combine two parsers where at least one must succeed. | or(u16l, u32l) |
take | Take N bytes. | take(42) |
seq | Run a parser N times in sequence. | seq(u32l, 42) |
tag | Match a sequence of bytes. | tag("hello") |
opt | Allow a parser to fail. | opt(tag("hello")) |
[pod ] | Transmute bytes into a type. Requires the bytemuck feature | seq(pod::<MyType>, 4) |
finish | Ensure there is no bytes left | finish(seq(u16l, 128)) |
Number parsers
u8 | u16 | u32 | u64 | u128 | f32 | f64 | |
---|---|---|---|---|---|---|---|
Little Endian | byte | u16l | u32l | u64l | u128l | f32l | f64l |
Big Endian | byte | u16b | u32b | u64b | u128b | f32b | f64b |
Features
bytemuck
: Enables the [pod
] parser
MSRV
Minimum supported Rust version is: 1.60
Structs
Enums
Functions
Parse 32-bit big-endian float.
Parse 32-bit little-endian float.
Parse 64-bit big-endian float.
Parse 64-bit little-endian float.
Parse signed 16-bit big-endian integer.
Parse signed 16-bit little-endian integer.
Parse signed 32-bit big-endian integer.
Parse signed 32-bit little-endian integer.
Parse signed 64-bit big-endian integer.
Parse signed 64-bit little-endian integer.
Parse signed 128-bit big-endian integer.
Parse signed 128-bit little-endian integer.
Parse unsigned 16-bit big-endian integer.
Parse unsigned 16-bit little-endian integer.
Parse unsigned 32-bit big-endian integer.
Parse unsigned 32-bit little-endian integer.
Parse unsigned 64-bit big-endian integer.
Parse unsigned 64-bit little-endian integer.
Parse unsigned 128-bit big-endian integer.
Parse unsigned 128-bit little-endian integer.