Struct redox_users::GroupBuilder
source · pub struct GroupBuilder { /* private fields */ }
Expand description
A builder pattern for adding Group
s to AllGroups
. Fields are
verified when the Group
is built, via AllGroups::add_group
.
§Example
// When added, this group will use the first available group id
let mygroup = GroupBuilder::new("group_name");
// A little more stuff:
let other = GroupBuilder::new("special")
.gid(9055)
.user("some_username");
Implementations§
source§impl GroupBuilder
impl GroupBuilder
sourcepub fn new(group: impl AsRef<str>) -> GroupBuilder
pub fn new(group: impl AsRef<str>) -> GroupBuilder
Create a new GroupBuilder
with the given group name.
sourcepub fn gid(self, gid: usize) -> GroupBuilder
pub fn gid(self, gid: usize) -> GroupBuilder
Set the group id of this group.
sourcepub fn user(self, user: impl AsRef<str>) -> GroupBuilder
pub fn user(self, user: impl AsRef<str>) -> GroupBuilder
Add a user to this group. Call this function multiple times to add more users.
Auto Trait Implementations§
impl Freeze for GroupBuilder
impl RefUnwindSafe for GroupBuilder
impl Send for GroupBuilder
impl Sync for GroupBuilder
impl Unpin for GroupBuilder
impl UnwindSafe for GroupBuilder
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