Skip to main content

Crate sorug

Crate sorug 

Source
Expand description

sorug — a blazingly fast, zero-allocation-preferred, WHATWG-compliant URL parser.

§Design

  • Index-based record: component boundaries live as u32 offsets into the WHATWG href serialization, keeping the struct small and cache-friendly.
  • Lazy / CoW serialization: when the input is already canonical ASCII, Url borrows it with zero heap allocations; the first required mutation upgrades to an owned buffer.
  • Cow on demand: percent-decoding helpers allocate only when needed.
  • SIMD delimiter scans: memchr on hot path segments.
  • Strict WHATWG state machine: transitions follow the URL Living Standard.

Structs§

Url
A parsed URL record backed by its WHATWG serialization (href).
UrlFlags
Compact boolean attributes of a parsed URL record.

Enums§

Backing
Storage for the WHATWG href serialization.
ParseError
Failure modes of Url::parse / the basic URL parser.
State
States of the WHATWG basic URL parser state machine.