Struct users::Group

source · []
pub struct Group { /* private fields */ }
Expand description

Information about a particular group.

For more information, see the module documentation.

Implementations

Create a new Group with the given group ID and name, with the rest of the fields filled in with dummy values.

This method does not actually create a new group on the system — it should only be used for comparing groups in tests.

Examples
use users::Group;

let group = Group::new(102, "database");

Returns this group’s ID.

Examples
use users::Group;

let group = Group::new(102, "database");
assert_eq!(group.gid(), 102);

Returns this group’s name.

Examples
use std::ffi::OsStr;
use users::Group;

let group = Group::new(102, "database");
assert_eq!(group.name(), OsStr::new("database"));

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns a slice of the list of users that are in this group as their non-primary group. Read more

Adds a new member to this group.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.