Skip to main content

PathExt

Trait PathExt 

Source
pub trait PathExt {
    // Required method
    fn with_all_extensions(&self, new_ext: &str) -> PathBuf;
}

Required Methods§

Source

fn with_all_extensions(&self, new_ext: &str) -> PathBuf

Return a new PathBuf with all existing extensions removed and replaced with new_ext.

ex: “foo.tar.gz” with new_ext="zip" becomes “foo.zip”

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl PathExt for Path

Source§

fn with_all_extensions(&self, new_ext: &str) -> PathBuf

Implementors§