Path parsing library, for Rust
libpath.Rust is a small Rust library for classifying Unix-like and Windows path syntax. It reports path components as positions into the original input string, without accessing the file system.
Reference libpath from Cargo.toml:
libpath = { version = "0.0.3" }The repository retains Cargo.lock to make local and CI verification
reproducible. Release and validation commands use --locked.
libpath::util::common::ClassificationResult describes the positions of
the input, root, directory, entry name, stem, extension, and related path
parts. Its fields use fastparse::fastparse::types::PositionalSlice.
libpath::util::unix::path_classify() classifies Unix-like paths and
returns libpath::util::unix::Classification together with a
ClassificationResult. The module also defines the parsing flag constants
in classification_flags.
libpath::util::windows::path_classify() classifies paths using forward
or backward separators, drive-letter roots and relative drive paths, and
the currently implemented tilde-rooted form. It returns the Windows
Classification and a ClassificationResult.
There are no maintained example programs yet. The libver binary is a
deliberately retained scratch utility that prints the package name and
version:
cargo run --bin libver
It is a repository utility rather than an example of the public path API.
Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/libpath.Rust.
Libraries upon which libpath.Rust depends:
- FastParse.Rust —
provides the public
PositionalSliceresult type;
None.
- test_help-rs — declared for repository test support;
No downstream consumers are currently recorded.
libpath.Rust is released under the 3-clause BSD license. See LICENSE for details.