Skip to main content

Module leaf

Module leaf 

Source

Functions§

any_span
cached_regex
Global regex cache — avoids recompiling the same pattern on repeated parser construction.
dispatch_byte
First-byte dispatch — O(1) branch selection by peeking the next byte.
dispatch_byte_multi
First-byte dispatch with multiple bytes mapping to the same parser. Avoids duplicating parsers for bytes that share the same handler (e.g., digits 0-9).
epsilon
next_span
one_of
Flat N-way alternation — tries each parser in order with checkpoint backtracking.
regex
regex_span
string
string_impl
string_span
take_until_any_span
Match one or more bytes until any byte in excluded is found. Uses a 256-byte LUT for branch-free scanning—10-15x faster than regex for negated character classes like /[^;{}!,]+/.
take_while_byte_span
Fast byte-level take_while — for ASCII predicates only.
take_while_span
trim_leading_whitespace
trim_leading_whitespace_mut
Convenience: skip leading whitespace, advancing the state offset.