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

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.

Type Definitions