pub struct URLParser;Expand description
Main parser struct for URL parsing, based on the grammar defined in grammar.pest.
§Grammar Rules
- url: Parses a complete URL structure including scheme, domain, path, query and fragment.
url = { scheme ~ “://” ~ domain ~ path? ~ query? ~ fragment? }
- scheme: Defines the URL scheme, which consists of alphanumeric characters (for example,
httporhttps).
scheme = @{ ASCII_ALPHANUMERIC+ }
- domain: Parses the domain of the URL, excluding
/and?characters to avoid conflicts with other components.
domain = @{ (!(“/” | “?”) ~ ANY)+ }
- path: Matches the path component, beginning with
/and excluding?and#to separate it from query and fragment components.
path = { “/” ~ (!(“?” | “#”) ~ ANY)* }
- query: Parses the query string of a URL, starting with
?and avoiding the fragment identifier#.
query = { “?” ~ (!“#” ~ ANY)* }
- fragment: Matches the fragment component of the URL, starting with
#and containing any characters after it.
fragment = { “#” ~ ANY* }
Trait Implementations§
Auto Trait Implementations§
impl Freeze for URLParser
impl RefUnwindSafe for URLParser
impl Send for URLParser
impl Sync for URLParser
impl Unpin for URLParser
impl UnwindSafe for URLParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more