uniform-path

    Cross-platform paths with consistent / separators.

    path
    posix
    windows
    unc
    normalization
    Download zip
    Author
    Version
    0.1.2
    License
    Apache-2.0
    Last updated
    12 hours ago
    Downloads
    6

    Dependencies

    #uniform-path

    Cross-platform paths with consistent / separators.

    ResolveError

    pub(all) suberror ResolveError {
    DriveBaseRequired(drive~ : String, base~ : Path)
    }

    A drive-relative path cannot be resolved without a base on the same drive.

    ResolveError::output

    fn ResolveError::output(self : ResolveError, logger : &Logger) -> Unit

    ResolveError::to_string

    fn ResolveError::to_string(self : ResolveError) -> String

    Path

    pub struct Path {
    // private fields
    } derive(Eq)

    Platform-independent lexical path with / separators. Roots are stored separately so POSIX normalization cannot collapse UNC's leading // or mistake C:/ for a relative path. Absolute paths clamp .. at the root; relative paths retain leading ... An empty relative portion denotes the root, or . without a root. Components retain literal backslashes. This type does not access the filesystem or resolve symlinks. See Linux filename rules and path resolution.
    impl Div for Path
    impl Show for Path
    impl ToJson for Path

    Path::Path

    fn Path::Path(input : String) -> Path

    Parse uniform syntax with / separators, preserving literal backslashes. Roots use /, C:/, C:, or //server/share/; drive letters are ASCII. Three or more leading slashes denote a POSIX root. Use from_windows to parse Windows separators explicitly.

    Path::basename

    fn Path::basename(self : Path) -> String

    Path::dirname

    fn Path::dirname(self : Path) -> Path

    Return the parent, stopping at POSIX, drive, and UNC share roots.

    Path::div

    fn Path::div(self : Path, other : Path) -> Path

    Path::equal

    fn Path::equal(Path, Path) -> Bool

    Path::from_windows

    fn Path::from_windows(input : String) -> Path

    Parse Windows drive, UNC, or relative syntax and convert its separators to / before entering the uniform representation. See Windows naming rules.

    Path::join

    fn Path::join(self : Path, other : Path) -> Path

    Append the relative portion of another normalized path, preserving this path's root. The other path's root is ignored. Both operands are already parsed and normalized.

    Path::not_equal

    fn Path::not_equal(x : Path, y : Path) -> Bool

    Path::output

    fn Path::output(self : Path, logger : &Logger) -> Unit

    Path::resolve

    fn Path::resolve(self : Path, other : Path) -> Path raise ResolveError

    Resolve another normalized path against this explicit base without reading the host environment. Absolute POSIX, drive, and UNC paths replace the base; ordinary relative paths are joined to it. The result can remain relative. A drive-relative path is joined to a base on the same drive, comparing drive letters without case sensitivity and preserving the base's root. Raises ResolveError::DriveBaseRequired when that drive base is unavailable.

    Path::to_json

    fn Path::to_json(self : Path) -> Json

    Path::to_string

    fn Path::to_string(self : Path) -> String

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io