pub struct MockUsers { /* private fields */ }Expand description
A mocking users table that you can add your own users and groups to.
Implementations§
Trait Implementations§
Source§impl Groups for MockUsers
impl Groups for MockUsers
Source§fn get_group_by_gid(&self, gid: gid_t) -> Option<Arc<Group>>
fn get_group_by_gid(&self, gid: gid_t) -> Option<Arc<Group>>
Returns a
Group if one exists for the given group ID; otherwise, returns None.Source§fn get_group_by_name<S: AsRef<OsStr> + ?Sized>(
&self,
group_name: &S,
) -> Option<Arc<Group>>
fn get_group_by_name<S: AsRef<OsStr> + ?Sized>( &self, group_name: &S, ) -> Option<Arc<Group>>
Returns a
Group if one exists for the given groupname; otherwise, returns None.Source§fn get_current_gid(&self) -> uid_t
fn get_current_gid(&self) -> uid_t
Returns the group ID for the user running the process.
Source§fn get_current_groupname(&self) -> Option<Arc<OsStr>>
fn get_current_groupname(&self) -> Option<Arc<OsStr>>
Returns the group name of the user running the process.
Source§fn get_effective_gid(&self) -> uid_t
fn get_effective_gid(&self) -> uid_t
Returns the effective group id.
Source§impl Users for MockUsers
impl Users for MockUsers
Source§fn get_user_by_uid(&self, uid: uid_t) -> Option<Arc<User>>
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>>
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
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>>
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
fn get_effective_uid(&self) -> uid_t
Returns the effective user id.
Auto Trait Implementations§
impl Freeze for MockUsers
impl RefUnwindSafe for MockUsers
impl Send for MockUsers
impl Sync for MockUsers
impl Unpin for MockUsers
impl UnsafeUnpin for MockUsers
impl UnwindSafe for MockUsers
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more