Skip to main content

Simplified

Trait Simplified 

Source
pub trait Simplified {
    // Required methods
    fn simplified(&self) -> &Path;
    fn simplified_display(&self) -> impl Display;
    fn simple_canonicalize(&self) -> Result<PathBuf>;
    fn user_display(&self) -> impl Display;
    fn user_display_from(&self, base: impl AsRef<Path>) -> impl Display;
    fn portable_display(&self) -> impl Display;
}

Required Methods§

Source

fn simplified(&self) -> &Path

Simplify a Path.

On Windows, this will strip the \\?\ prefix from paths. On other platforms, it’s a no-op.

Source

fn simplified_display(&self) -> impl Display

Render a Path for display.

On Windows, this will strip the \\?\ prefix from paths. On other platforms, it’s equivalent to std::path::Display.

Source

fn simple_canonicalize(&self) -> Result<PathBuf>

Canonicalize a path, stripping the \\?\ prefix on Windows when possible.

Source

fn user_display(&self) -> impl Display

Render a Path for user-facing display.

Like [simplified_display], but relativizes the path against the current working directory.

Source

fn user_display_from(&self, base: impl AsRef<Path>) -> impl Display

Render a Path for user-facing display, where the Path is relative to a base path.

If the Path is not relative to the base path, will attempt to relativize the path against the current working directory.

Source

fn portable_display(&self) -> impl Display

Render a Path for user-facing display using a portable representation.

Like [user_display], but uses a portable representation for relative paths.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: AsRef<Path>> Simplified for T