pub struct UsersCache { /* private fields */ }
Expand description

A producer of user and group instances that caches every result.

For more information, see the users::cache module documentation.

Implementations

Creates a new empty cache.

Examples
use users::cache::UsersCache;

let cache = UsersCache::new();

Creates a new cache that contains all the users present on the system.

Safety

This is unsafe because we cannot prevent data races if two caches were attempted to be initialised on different threads at the same time. For more information, see the all_users documentation.

Examples
use users::cache::UsersCache;

let cache = unsafe { UsersCache::with_all_users() };

Trait Implementations

Returns the “default value” for a type. Read more

Returns a Group if one exists for the given group ID; otherwise, returns None.

Returns a Group if one exists for the given groupname; otherwise, returns None.

Returns the group ID for the user running the process.

Returns the group name of the user running the process.

Returns the effective group id.

Returns the effective group name.

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

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

Returns the user ID for the user running the process.

Returns the username of the user running the process.

Returns the effective user id.

Returns the effective username.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.