PathExt

Trait PathExt 

Source
pub trait PathExt: PathExt {
    // Required method
    fn ensure_extension<S: AsRef<OsStr>>(&self, extension: S) -> Cow<'_, Path>;
}
Expand description

Extension trait for Path for common functionality in BP3D software.

Required Methods§

Source

fn ensure_extension<S: AsRef<OsStr>>(&self, extension: S) -> Cow<'_, Path>

Ensures the given extension is present on a Path. Reallocates a new PathBuf if no extension is present or that the extension is incorrect.

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.

Implementations on Foreign Types§

Source§

impl PathExt for Path

Source§

fn ensure_extension<S: AsRef<OsStr>>(&self, extension: S) -> Cow<'_, Path>

Implementors§