PathName

Trait PathName 

Source
pub trait PathName: Sealed {
    // Required method
    fn path_name(&self) -> Result<&NonEmptyStr, Error>;

    // Provided method
    fn path_name_owned(&self) -> Result<NonEmptyString, Error> { ... }
}
Expand description

Fetching path names.

Required Methods§

Source

fn path_name(&self) -> Result<&NonEmptyStr, Error>

Tries to return the path name as non-empty string.

§Errors

Returns [Error] if the path name was not found, empty, or invalid UTF-8.

Provided Methods§

Source

fn path_name_owned(&self) -> Result<NonEmptyString, Error>

Similar to path_name, but returns non-empty owned strings.

§Errors

See path_name.

Implementors§

Source§

impl<P: AsRef<Path>> PathName for P