Struct redox_users::AllUsers
source · pub struct AllUsers<A> { /* private fields */ }
Expand description
AllUsers
provides (borrowed) access to all the users on the system.
Note that this struct implements All
for all of its access functions.
§Notes
Note that everything in this section also applies to AllGroups
.
- If you mutate anything owned by an
AllUsers
, you must call theAllUsers::save
in order for those changes to be applied to the system. - The API here is kept small. Most mutating actions can be accomplished via
the
All::get_mut_by_id
andAll::get_mut_by_name
functions.
Implementations§
source§impl AllUsers<Full>
impl AllUsers<Full>
sourcepub fn authenticator(config: Config) -> Result<AllUsers<Full>, Error>
pub fn authenticator(config: Config) -> Result<AllUsers<Full>, Error>
If access to password related methods for the User
s yielded by this
AllUsers
is required, use this constructor.
sourcepub fn add_user(&mut self, builder: UserBuilder) -> Result<&User<Full>, Error>
pub fn add_user(&mut self, builder: UserBuilder) -> Result<&User<Full>, Error>
Consumes a builder, adding a new user to this AllUsers
. Returns a
reference to the created user.
Make sure to call AllUsers::save
in order for the new user to be
applied to the system.
Note that the user’s password is set unset (see Unset vs Blank Passwords) during this call.
Also note that the user is not added to any groups when this builder is
consumed. In order to keep the system in a consistent state, it is
reccomended to also use an instance of AllGroups
to update group
information when creating new users.
§Defaults
Fields not passed to the builder before calling this function are as follows:
uid
:AllUsers::get_unique_id
is called on self to get the next available id.gid
:99
. This is the default UID for the groupnobody
. Note that the user is NOT added to this group in/etc/groups
.name
: The login name passed toUserBuilder::new
.home
:"/"
shell
:file:/bin/ion
Trait Implementations§
source§impl<A> All for AllUsers<A>
impl<A> All for AllUsers<A>
source§fn get_mut_by_name(
&mut self,
name: impl AsRef<str>
) -> Option<&mut <Self as AllInner>::Gruser>
fn get_mut_by_name( &mut self, name: impl AsRef<str> ) -> Option<&mut <Self as AllInner>::Gruser>
All::get_by_name
.source§fn get_mut_by_id(
&mut self,
id: usize
) -> Option<&mut <Self as AllInner>::Gruser>
fn get_mut_by_id( &mut self, id: usize ) -> Option<&mut <Self as AllInner>::Gruser>
All::get_by_id
.source§fn get_unique_id(&self) -> Option<usize>
fn get_unique_id(&self) -> Option<usize>
source§fn remove_by_id(&mut self, id: usize) -> bool
fn remove_by_id(&mut self, id: usize) -> bool
All::remove_by_name
.