Crate parz

Source
Expand description

Minimal parser combinators

§Basic parsers

ItemsDescriptionExample
andCombine two parsers where both must succeed.and(u16l, u32l)
orCombine two parsers where at least one must succeed.or(u16l, u32l)
takeTake N bytes.take(42)
seqRun a parser N times in sequence.seq(u32l, 42)
tagMatch a sequence of bytes.tag("hello")
optAllow a parser to fail.opt(tag("hello"))
[pod]Transmute bytes into a type. Requires the bytemuck featureseq(pod::<MyType>, 4)
finishEnsure there is no bytes leftfinish(seq(u16l, 128))

§Number parsers

u8u16u32u64u128f32f64
Little Endianbyteu16lu32lu64lu128lf32lf64l
Big Endianbyteu16bu32bu64bu128bf32bf64b

§Features

  • bytemuck: Enables the [pod] parser

§MSRV

Minimum supported Rust version is: 1.60

Structs§

ByteError
F32BError
F32LError
F64BError
F64LError
FinishError
I16BError
I16LError
I32BError
I32LError
I64BError
I64LError
I128BError
I128LError
SeqError
TagError
TakeError
U16BError
U16LError
U32BError
U32LError
U64BError
U64LError
U128BError
U128LError

Enums§

OptError

Functions§

and
byte
f32b
Parse 32-bit big-endian float.
f32l
Parse 32-bit little-endian float.
f64b
Parse 64-bit big-endian float.
f64l
Parse 64-bit little-endian float.
finish
i16b
Parse signed 16-bit big-endian integer.
i16l
Parse signed 16-bit little-endian integer.
i32b
Parse signed 32-bit big-endian integer.
i32l
Parse signed 32-bit little-endian integer.
i64b
Parse signed 64-bit big-endian integer.
i64l
Parse signed 64-bit little-endian integer.
i128b
Parse signed 128-bit big-endian integer.
i128l
Parse signed 128-bit little-endian integer.
opt
or
seq
tag
take
u16b
Parse unsigned 16-bit big-endian integer.
u16l
Parse unsigned 16-bit little-endian integer.
u32b
Parse unsigned 32-bit big-endian integer.
u32l
Parse unsigned 32-bit little-endian integer.
u64b
Parse unsigned 64-bit big-endian integer.
u64l
Parse unsigned 64-bit little-endian integer.
u128b
Parse unsigned 128-bit big-endian integer.
u128l
Parse unsigned 128-bit little-endian integer.

Type Aliases§

Step