Skip to main contentModule span_parser
Source - SpanParser
- sp_any
- Match any of the given string patterns (Aho-Corasick). Compiled at construction time.
- sp_boxed
- Wrap a boxed
ParserFn as a SpanParser escape hatch. - sp_eof
- End-of-input check for SpanParser. Succeeds with an empty Span at EOF.
- sp_epsilon
- Always succeeds, consuming nothing (empty span).
- sp_json_number
- Monolithic JSON number scanner.
- sp_json_string
- Monolithic JSON string scanner — SIMD-accelerated via memchr2.
Returns span of content between quotes (exclusive of delimiters).
- sp_json_string_quoted
- Monolithic JSON string scanner — SIMD-accelerated via memchr2.
Returns span including the quote delimiters (matches regex behavior).
- sp_next
- Consume exactly N bytes.
- sp_regex
- Match regex pattern. Uses global cache to avoid recompilation.
- sp_string
- Match exact string literal (byte comparison).
The string must be
'static (string literals, leaked strings). - sp_take_until_any
- Match one or more bytes until any byte in
excluded is found.
Enum-dispatched LUT scanner — no boxing, no vtable. - sp_take_while_byte
- Take bytes while predicate holds (byte-level, ASCII-safe).
- sp_take_while_char
- Take characters while predicate holds (char-level, Unicode-safe).