Struct Groups

Source
pub struct Groups(/* private fields */);
Expand description

Struct implementing handling of groups both as numerical values and as bitmasks.

Implementations§

Source§

impl Groups

Source

pub fn empty() -> Self

Create an empty set of netlink multicast groups

Source

pub fn new_bitmask(mask: u32) -> Self

Create a new set of groups with a bitmask. Each bit represents a group.

Source

pub fn add_bitmask(&mut self, mask: u32)

Add a new bitmask to the existing group set. Each bit represents a group.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn as_bitmask(&self) -> Result<u32, MsgError>

Return the set of groups as a bitmask. The representation of a bitmask is u32.

Source

pub fn as_groups(&self) -> Vec<u32>

Return the set of groups as a vector of group values.

Source

pub fn into_groups(self) -> Vec<u32>

Return the set of groups as a vector of group values.

Source

pub fn is_empty(&self) -> bool

Returns true if no group is set.

Auto Trait Implementations§

§

impl Freeze for Groups

§

impl RefUnwindSafe for Groups

§

impl Send for Groups

§

impl Sync for Groups

§

impl Unpin for Groups

§

impl UnwindSafe for Groups

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.