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§
Sourceconst SEPARATOR: &str = MAIN_SEPARATOR_STR
const SEPARATOR: &str = MAIN_SEPARATOR_STR
The primary separator string of path components for the current platform.
See std::path::
MAIN_SEPARATOR_STR.
Sourceconst SEPARATOR_CHAR: char = '/'
const SEPARATOR_CHAR: char = '/'
The primary separator char of path components for the current platform.
See std::path::
MAIN_SEPARATOR.
Required Methods§
Sourcefn to_absolute(&self) -> IoResult<PathBuf>
fn to_absolute(&self) -> IoResult<PathBuf>
Makes the current path absolute without accessing the filesystem.
See std::path::
absolute
and Self::absolute
.
Provided Methods§
Sourcefn absolute<P: AsRef<Path>>(path: P) -> IoResult<PathBuf>
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
.
Sourcefn is_separator(c: char) -> bool
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.