Users

Trait Users 

Source
pub trait Users {
    // Required methods
    fn get_user_by_uid(&self, uid: uid_t) -> Option<Arc<User>>;
    fn get_user_by_name<S: AsRef<OsStr> + ?Sized>(
        &self,
        username: &S,
    ) -> Option<Arc<User>>;
    fn get_current_uid(&self) -> uid_t;
    fn get_current_username(&self) -> Option<Arc<OsStr>>;
    fn get_effective_uid(&self) -> uid_t;
    fn get_effective_username(&self) -> Option<Arc<OsStr>>;
}
Expand description

Trait for producers of users.

Required Methods§

Source

fn get_user_by_uid(&self, uid: uid_t) -> Option<Arc<User>>

Returns a User if one exists for the given user ID; otherwise, returns None.

Source

fn get_user_by_name<S: AsRef<OsStr> + ?Sized>( &self, username: &S, ) -> Option<Arc<User>>

Returns a User if one exists for the given username; otherwise, returns None.

Source

fn get_current_uid(&self) -> uid_t

Returns the user ID for the user running the process.

Source

fn get_current_username(&self) -> Option<Arc<OsStr>>

Returns the username of the user running the process.

Source

fn get_effective_uid(&self) -> uid_t

Returns the effective user id.

Source

fn get_effective_username(&self) -> Option<Arc<OsStr>>

Returns the effective username.

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§