Trait UserExt

Source
pub trait UserExt {
    // Required methods
    fn home_dir(&self) -> &Path;
    fn with_home_dir<S: AsRef<OsStr> + ?Sized>(self, home_dir: &S) -> Self;
    fn shell(&self) -> &Path;
    fn with_shell<S: AsRef<OsStr> + ?Sized>(self, shell: &S) -> Self;
    fn password(&self) -> &OsStr;
    fn with_password<S: AsRef<OsStr> + ?Sized>(self, password: &S) -> Self;
}
Expand description

Unix-specific extensions for Users.

Required Methods§

Source

fn home_dir(&self) -> &Path

Returns a path to this user’s home directory.

Source

fn with_home_dir<S: AsRef<OsStr> + ?Sized>(self, home_dir: &S) -> Self

Sets this user value’s home directory to the given string. Can be used to construct test users, which by default come with a dummy home directory string.

Source

fn shell(&self) -> &Path

Returns a path to this user’s shell.

Source

fn with_shell<S: AsRef<OsStr> + ?Sized>(self, shell: &S) -> Self

Sets this user’s shell path to the given string. Can be used to construct test users, which by default come with a dummy shell field.

Source

fn password(&self) -> &OsStr

Returns the user’s encrypted password.

Source

fn with_password<S: AsRef<OsStr> + ?Sized>(self, password: &S) -> Self

Sets this user’s password to the given string. Can be used to construct tests users, which by default come with a dummy password field.

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§