Skip to content

Repository files navigation

libpath.Rust

Path parsing library, for Rust

Language License Crates.io GitHub release MSRV CI docs.rs

Table of Contents

Introduction

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.

Installation

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.

Components

Common result type

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.

Unix path classification

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.

Windows path classification

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.

Examples

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.

Project Information

Where to get help

GitHub Page

Contribution guidelines

Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/libpath.Rust.

Dependencies

Efferent (fan-out)

Libraries upon which libpath.Rust depends:

Runtime Dependencies
Build Dependencies

None.

Development Dependencies

Afferent (fan-in)

No downstream consumers are currently recorded.

Related projects

License

libpath.Rust is released under the 3-clause BSD license. See LICENSE for details.

Releases

Packages

Used by

Contributors

Languages