devela::all

Trait ExtPath

Source
pub trait ExtPath: Sealed {
    const SEPARATOR: &str = MAIN_SEPARATOR_STR;
    const SEPARATOR_CHAR: char = '/';

    // Required method
    fn to_absolute(&self) -> IoResult<PathBuf>;

    // Provided methods
    fn absolute<P: AsRef<Path>>(path: P) -> IoResult<PathBuf> { ... }
    fn is_separator(c: char) -> bool { ... }
}
Available on crate feature std only.
Expand description

Extension trait providing additional methods for paths.

Provided Associated Constants§

Source

const SEPARATOR: &str = MAIN_SEPARATOR_STR

The primary separator string of path components for the current platform.

See std::path::MAIN_SEPARATOR_STR.

Source

const SEPARATOR_CHAR: char = '/'

The primary separator char of path components for the current platform.

See std::path::MAIN_SEPARATOR.

Required Methods§

Source

fn to_absolute(&self) -> IoResult<PathBuf>

Makes the current path absolute without accessing the filesystem.

See std::path::absolute and Self::absolute.

Provided Methods§

Source

fn absolute<P: AsRef<Path>>(path: P) -> IoResult<PathBuf>

Makes the given path absolute without accessing the filesystem.

See std::path::absolute and Self::to_absolute.

Source

fn is_separator(c: char) -> bool

Determines whether the character is one of the permitted path separators for the current platform.

See std::path::is_separator.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§