Struct users::cache::UsersCache [−][src]
pub struct UsersCache { /* fields omitted */ }A producer of user and group instances that caches every result.
Methods
impl UsersCache[src]
impl UsersCachepub fn new() -> Self[src]
pub fn new() -> SelfCreates a new empty cache.
pub unsafe fn with_all_users() -> Self[src]
pub unsafe fn with_all_users() -> SelfCreates a new cache that contains all the users present on the system.
This is unsafe because we cannot prevent data races if two caches
were attempted to be initialised on different threads at the same time.
Trait Implementations
impl Default for UsersCache[src]
impl Default for UsersCacheimpl Users for UsersCache[src]
impl Users for UsersCachefn get_user_by_uid(&self, uid: uid_t) -> Option<Arc<User>>[src]
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.
fn get_user_by_name<S: AsRef<OsStr> + ?Sized>(
&self,
username: &S
) -> Option<Arc<User>>[src]
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.
fn get_current_uid(&self) -> uid_t[src]
fn get_current_uid(&self) -> uid_tReturns the user ID for the user running the process.
fn get_current_username(&self) -> Option<Arc<OsString>>[src]
fn get_current_username(&self) -> Option<Arc<OsString>>Returns the username of the user running the process.
fn get_effective_uid(&self) -> uid_t[src]
fn get_effective_uid(&self) -> uid_tReturns the effective user id.
fn get_effective_username(&self) -> Option<Arc<OsString>>[src]
fn get_effective_username(&self) -> Option<Arc<OsString>>Returns the effective username.
impl Groups for UsersCache[src]
impl Groups for UsersCachefn get_group_by_gid(&self, gid: gid_t) -> Option<Arc<Group>>[src]
fn get_group_by_gid(&self, gid: gid_t) -> Option<Arc<Group>>Returns a Group object if one exists for the given group ID; otherwise, returns None.
fn get_group_by_name<S: AsRef<OsStr> + ?Sized>(
&self,
group_name: &S
) -> Option<Arc<Group>>[src]
fn get_group_by_name<S: AsRef<OsStr> + ?Sized>(
&self,
group_name: &S
) -> Option<Arc<Group>>Returns a Group object if one exists for the given groupname; otherwise, returns None.
fn get_current_gid(&self) -> gid_t[src]
fn get_current_gid(&self) -> gid_tReturns the group ID for the user running the process.
fn get_current_groupname(&self) -> Option<Arc<OsString>>[src]
fn get_current_groupname(&self) -> Option<Arc<OsString>>Returns the group name of the user running the process.
fn get_effective_gid(&self) -> gid_t[src]
fn get_effective_gid(&self) -> gid_tReturns the effective group id.
fn get_effective_groupname(&self) -> Option<Arc<OsString>>[src]
fn get_effective_groupname(&self) -> Option<Arc<OsString>>Returns the effective group name.
Auto Trait Implementations
impl Send for UsersCache
impl Send for UsersCacheimpl !Sync for UsersCache
impl !Sync for UsersCache