Trait bp3d_util::path::PathExt

source ·
pub trait PathExt: Sealed {
    // Required method
    fn ensure_extension<S: AsRef<OsStr>>(&self, extension: S) -> Cow<'_, Path>;
}
Available on crate feature path only.
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.

Object Safety§

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§