pub struct Groups(/* private fields */);
Expand description
Struct implementing handling of groups both as numerical values and as bitmasks.
Implementations§
Source§impl Groups
impl Groups
Sourcepub fn new_bitmask(mask: u32) -> Self
pub fn new_bitmask(mask: u32) -> Self
Create a new set of groups with a bitmask. Each bit represents a group.
Sourcepub fn add_bitmask(&mut self, mask: u32)
pub fn add_bitmask(&mut self, mask: u32)
Add a new bitmask to the existing group set. Each bit represents a group.
Sourcepub fn remove_bitmask(&mut self, mask: u32)
pub fn remove_bitmask(&mut self, mask: u32)
Remove a bitmask from the existing group set. Each bit represents a group and each bit set to 1 will be removed.
Sourcepub fn new_groups(groups: &[u32]) -> Self
pub fn new_groups(groups: &[u32]) -> Self
Create a new set of groups from a list of numerical groups values. This differs from the bitmask representation where the value 3 represents group 3 in this format as opposed to 0x4 in the bitmask format.
Sourcepub fn add_groups(&mut self, groups: &[u32])
pub fn add_groups(&mut self, groups: &[u32])
Add a list of numerical groups values to the set of groups. This differs from the bitmask representation where the value 3 represents group 3 in this format as opposed to 0x4 in the bitmask format.
Sourcepub fn remove_groups(&mut self, groups: &[u32])
pub fn remove_groups(&mut self, groups: &[u32])
Remove a list of numerical groups values from the set of groups. This differs from the bitmask representation where the value 3 represents group 3 in this format as opposed to 0x4 in the bitmask format.
Sourcepub fn as_bitmask(&self) -> Result<u32, MsgError>
pub fn as_bitmask(&self) -> Result<u32, MsgError>
Return the set of groups as a bitmask. The representation of a bitmask is u32.
Sourcepub fn into_groups(self) -> Vec<u32>
pub fn into_groups(self) -> Vec<u32>
Return the set of groups as a vector of group values.