PathExt

Trait PathExt 

Source
pub trait PathExt {
    const PATH_SEPARATOR: char;

    // Required methods
    fn relative_to<'s, P: AsRef<Path>>(
        &'s self,
        ancestor: &P,
    ) -> Option<RelPath<'s>>;
    fn same_fs_as<P: AsRef<Path>>(&self, other: &P) -> bool;
    fn rename_safe<P: AsRef<Path>>(&self, target: &P) -> Result<(), FileError>;
    fn copy_dir_all<P: AsRef<Path>>(&self, target: &P) -> Result<(), FileError>;
    fn join_uri_path(&self, path: &UriPath) -> PathBuf;
    fn as_slash_str(&self) -> Cow<'_, str>;
}

Required Associated Constants§

Required Methods§

Source

fn relative_to<'s, P: AsRef<Path>>( &'s self, ancestor: &P, ) -> Option<RelPath<'s>>

Source

fn same_fs_as<P: AsRef<Path>>(&self, other: &P) -> bool

Source

fn rename_safe<P: AsRef<Path>>(&self, target: &P) -> Result<(), FileError>

§Errors
Source

fn copy_dir_all<P: AsRef<Path>>(&self, target: &P) -> Result<(), FileError>

§Errors
Source

fn join_uri_path(&self, path: &UriPath) -> PathBuf

Source

fn as_slash_str(&self) -> Cow<'_, str>

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.

Implementors§