pub struct GroupBuilder { /* private fields */ }Expand description
A builder pattern for adding Groups 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.