Crate dcbor_pattern

Source
Expand description

§dCBOR Pattern Matching

Modules§

meta
value

Structs§

AndPattern
A pattern that matches if all contained patterns match.
AnyPattern
A pattern that always matches any CBOR value.
CapturePattern
A pattern that captures matches.
FormatPathsOpts
Options for formatting paths.
Interval
Represents an inclusive interval with a minimum value and an optional maximum value.
NotPattern
A pattern that negates another pattern; matches when the inner pattern does not match.
NullPattern
Pattern for matching null values in dCBOR.
OrPattern
A pattern that matches if any contained pattern matches.
Program
Quantifier
Defines how many times a pattern may or must match, with an interval and a reluctance.
RepeatPattern
A pattern that matches with repetition using a quantifier.
SearchPattern
A pattern that searches the entire dCBOR tree for matches.
SequencePattern
A pattern that matches a sequence of patterns in order.
Vm
VM for executing pattern programs against dCBOR values.

Enums§

ArrayPattern
Pattern for matching CBOR array structures.
Axis
Navigation axis for traversing dCBOR tree structures.
BoolPattern
Pattern for matching boolean values in dCBOR.
ByteStringPattern
Pattern for matching byte string values in dCBOR.
DatePattern
Pattern for matching date values in dCBOR.
DigestPattern
Pattern for matching dCBOR digest values (CBOR tag 40001).
Error
Errors that can occur during parsing of dCBOR patterns.
Instr
Bytecode instructions for the pattern VM.
KnownValuePattern
Pattern for matching known values.
MapPattern
Pattern for matching CBOR map structures.
MetaPattern
Pattern for combining and modifying other patterns.
NumberPattern
Pattern for matching number values in dCBOR.
PathElementFormat
A builder that provides formatting options for each path element.
Pattern
Reluctance
Reluctance for quantifiers.
StructurePattern
TaggedPattern
Pattern for matching CBOR tagged value structures.
TextPattern
Pattern for matching text values in dCBOR.
Token
Tokens for the Gordian Envelope pattern syntax.
ValuePattern

Functions§

format_path
Format each path element on its own line, each line successively indented by 4 spaces.
format_path_opt
Format each path element on its own line, each line successively indented by 4 spaces. Options can be provided to customize the formatting.
format_paths
Format multiple paths with default options.
format_paths_opt
Format multiple paths with custom formatting options.
format_paths_with_captures
Format multiple paths with captures in a structured way. Captures come first, sorted lexicographically by name, with their name prefixed by ‘@’. Regular paths follow after all captures.
run
Execute a program against a dCBOR value, returning all matching paths and captures.

Type Aliases§

Path
Result
A Result type specialized for dCBOR pattern parsing.