pub struct GroupMemberFlags(/* private fields */);Expand description
Represents a bitfield.
Implementations§
Source§impl GroupMemberFlags
impl GroupMemberFlags
Sourcepub const IS_SELF_BITS: u32 = 1u32
pub const IS_SELF_BITS: u32 = 1u32
The number of bits is_self occupies in the bitfield.
Sourcepub const IS_SELF_OFFSET: u32 = 0u32
pub const IS_SELF_OFFSET: u32 = 0u32
The bitfield start bit of is_self.
Sourcepub const IS_IN_INSTANCE_BITS: u32 = 1u32
pub const IS_IN_INSTANCE_BITS: u32 = 1u32
The number of bits is_in_instance occupies in the bitfield.
Sourcepub const IS_IN_INSTANCE_OFFSET: u32 = 1u32
pub const IS_IN_INSTANCE_OFFSET: u32 = 1u32
The bitfield start bit of is_in_instance.
Sourcepub const IS_COMMANDER_BITS: u32 = 1u32
pub const IS_COMMANDER_BITS: u32 = 1u32
The number of bits is_commander occupies in the bitfield.
Sourcepub const IS_COMMANDER_OFFSET: u32 = 2u32
pub const IS_COMMANDER_OFFSET: u32 = 2u32
The bitfield start bit of is_commander.
Sourcepub const IS_LIEUTENANT_BITS: u32 = 1u32
pub const IS_LIEUTENANT_BITS: u32 = 1u32
The number of bits is_lieutenant occupies in the bitfield.
Sourcepub const IS_LIEUTENANT_OFFSET: u32 = 3u32
pub const IS_LIEUTENANT_OFFSET: u32 = 3u32
The bitfield start bit of is_lieutenant.
Sourcepub const fn new_without_defaults() -> Self
pub const fn new_without_defaults() -> Self
Creates a new bitfield instance without setting any default values.
Sourcepub const fn from_bits_with_defaults(bits: u32) -> Self
pub const fn from_bits_with_defaults(bits: u32) -> Self
Creates a new bitfield instance from the given bits while respecting field default values.
Sourcepub const fn is_in_instance(&self) -> bool
pub const fn is_in_instance(&self) -> bool
Returns bit 1.
Sourcepub const fn is_commander(&self) -> bool
pub const fn is_commander(&self) -> bool
Returns bit 2.
Sourcepub const fn is_lieutenant(&self) -> bool
pub const fn is_lieutenant(&self) -> bool
Returns bit 3.
Sourcepub const fn set_is_self(&mut self, bits: bool)
pub const fn set_is_self(&mut self, bits: bool)
Sets bit 0.
Sourcepub const fn checked_set_is_self(
&mut self,
bits: bool,
) -> Result<(), &'static str>
pub const fn checked_set_is_self( &mut self, bits: bool, ) -> Result<(), &'static str>
Sets bit 0. Returns an error if the value is too big to fit within the field bit.
Sourcepub const fn set_is_in_instance(&mut self, bits: bool)
pub const fn set_is_in_instance(&mut self, bits: bool)
Sets bit 1.
Sourcepub const fn checked_set_is_in_instance(
&mut self,
bits: bool,
) -> Result<(), &'static str>
pub const fn checked_set_is_in_instance( &mut self, bits: bool, ) -> Result<(), &'static str>
Sets bit 1. Returns an error if the value is too big to fit within the field bit.
Sourcepub const fn set_is_commander(&mut self, bits: bool)
pub const fn set_is_commander(&mut self, bits: bool)
Sets bit 2.
Sourcepub const fn checked_set_is_commander(
&mut self,
bits: bool,
) -> Result<(), &'static str>
pub const fn checked_set_is_commander( &mut self, bits: bool, ) -> Result<(), &'static str>
Sets bit 2. Returns an error if the value is too big to fit within the field bit.
Sourcepub const fn set_is_lieutenant(&mut self, bits: bool)
pub const fn set_is_lieutenant(&mut self, bits: bool)
Sets bit 3.
Sourcepub const fn checked_set_is_lieutenant(
&mut self,
bits: bool,
) -> Result<(), &'static str>
pub const fn checked_set_is_lieutenant( &mut self, bits: bool, ) -> Result<(), &'static str>
Sets bit 3. Returns an error if the value is too big to fit within the field bit.
Sourcepub fn set_bits_with_defaults(&mut self, bits: u32)
pub fn set_bits_with_defaults(&mut self, bits: u32)
Sets the writable bits of the bitfield while respecting defaults.
Sourcepub fn clear_bits(&mut self)
pub fn clear_bits(&mut self)
Clears the writable bits of the bitfield.
Sourcepub fn clear_bits_with_defaults(&mut self)
pub fn clear_bits_with_defaults(&mut self)
Clears the writable bits of the bitfield.
Trait Implementations§
Source§impl Clone for GroupMemberFlags
impl Clone for GroupMemberFlags
Source§fn clone(&self) -> GroupMemberFlags
fn clone(&self) -> GroupMemberFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more