Trait bp3d_os::fs::PathExt

source ·
pub trait PathExt: Sealed {
    fn ensure_extension<S: AsRef<OsStr>>(&self, extension: S) -> Cow<'_, Path>;
    fn get_absolute(&self) -> Result<PathBuf>;
    fn is_hidden(&self) -> bool;
}
Available on crate feature fs only.
Expand description

Extension trait for Path for common functionality in BP3D software.

Required Methods§

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

Converts this path to an absolute path.

On Windows, this function will try it’s best to avoid using UNC paths which aren’t supported by all applications.

returns: Result<PathBuf, Error>

Errors

Returns an Error if the path couldn’t be converted to an absolute path.

Checks if this path is hidden in the current platform’s file explorer.

Implementations on Foreign Types§

Implementors§