Crates.io | url_pest_parser |
lib.rs | url_pest_parser |
version | 0.1.0 |
source | src |
created_at | 2024-11-06 23:10:58.570239 |
updated_at | 2024-11-06 23:10:58.570239 |
description | A URL parser using pest for Rust. |
homepage | |
repository | |
max_upload_size | |
id | 1439304 |
size | 19,434 |
A Rust-based URL parser using the pest
parsing library with ability to extract various components like protocol, domain, subdomain, port, path segments, query parameters, and fragments.
The grammar is defined using pest
and covers the following components:
/
, representing directories or resources.&
.#
.The parser processes URLs by breaking them into components using predefined grammar. Then the results are encapsulated in a structured ParsedURL
object.
protocol://subdomain.domain:port/path/to/resource?param1=value1¶m2=value2#section
└── protocol = "https"
└── subdomain = "sub"
└── domain = "example.com"
└── port = 8080
└── path = ["path", "to", "resource"]
└── query = [("param1", "value1"), ("param2", "value2")]
└── fragment = "section"