Skip to main content

PathExt

Trait PathExt 

Source
pub trait PathExt {
    // Required methods
    fn set_owner<E: Into<FileOwnerError>>(
        &self,
        owner: impl TryInto<Owner, Error = E>,
    ) -> Result<(), FileOwnerError>;
    fn set_group<E: Into<FileOwnerError>>(
        &self,
        group: impl TryInto<Group, Error = E>,
    ) -> Result<(), FileOwnerError>;
    fn set_owner_group<E1: Into<FileOwnerError>, E2: Into<FileOwnerError>>(
        &self,
        owner: impl TryInto<Owner, Error = E1>,
        group: impl TryInto<Group, Error = E2>,
    ) -> Result<(), FileOwnerError>;
    fn owner(&self) -> Result<Owner, FileOwnerError>;
    fn group(&self) -> Result<Group, FileOwnerError>;
    fn owner_group(&self) -> Result<(Owner, Group), FileOwnerError>;
}
Expand description

Extension methods for T: AsRef<Path>.

Required Methods§

Source

fn set_owner<E: Into<FileOwnerError>>( &self, owner: impl TryInto<Owner, Error = E>, ) -> Result<(), FileOwnerError>

Sets owner to file at the given path.

Source

fn set_group<E: Into<FileOwnerError>>( &self, group: impl TryInto<Group, Error = E>, ) -> Result<(), FileOwnerError>

Sets group to file at the given path.

Source

fn set_owner_group<E1: Into<FileOwnerError>, E2: Into<FileOwnerError>>( &self, owner: impl TryInto<Owner, Error = E1>, group: impl TryInto<Group, Error = E2>, ) -> Result<(), FileOwnerError>

Sets owner and group to file at the given path.

Source

fn owner(&self) -> Result<Owner, FileOwnerError>

Gets owner of a file at the given path.

Source

fn group(&self) -> Result<Group, FileOwnerError>

Gets group of a file at the given path.

Source

fn owner_group(&self) -> Result<(Owner, Group), FileOwnerError>

Gets owner and group of a file at the given path.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<T: AsRef<Path>> PathExt for T