pub struct GroupMemberFlagsBuilder { /* private fields */ }Expand description
A builder for the bitfield.
Implementations§
Source§impl GroupMemberFlagsBuilder
impl GroupMemberFlagsBuilder
Sourcepub fn new_without_defaults() -> Self
pub fn new_without_defaults() -> Self
Creates a new bitfield builder instance without setting any default values.
Sourcepub fn with_is_self(self, bits: bool) -> Self
pub fn with_is_self(self, bits: bool) -> Self
Sets builder bits [0..=1].
Sourcepub fn checked_with_is_self(self, bits: bool) -> Result<Self, &'static str>
pub fn checked_with_is_self(self, bits: bool) -> Result<Self, &'static str>
Sets builder bits [0..=1]. Returns an error if the value is too big to fit within the field bits.
Sourcepub fn with_is_in_instance(self, bits: bool) -> Self
pub fn with_is_in_instance(self, bits: bool) -> Self
Sets builder bits [1..=2].
Sourcepub fn checked_with_is_in_instance(
self,
bits: bool,
) -> Result<Self, &'static str>
pub fn checked_with_is_in_instance( self, bits: bool, ) -> Result<Self, &'static str>
Sets builder bits [1..=2]. Returns an error if the value is too big to fit within the field bits.
Sourcepub fn with_is_commander(self, bits: bool) -> Self
pub fn with_is_commander(self, bits: bool) -> Self
Sets builder bits [2..=3].
Sourcepub fn checked_with_is_commander(self, bits: bool) -> Result<Self, &'static str>
pub fn checked_with_is_commander(self, bits: bool) -> Result<Self, &'static str>
Sets builder bits [2..=3]. Returns an error if the value is too big to fit within the field bits.
Sourcepub fn with_is_lieutenant(self, bits: bool) -> Self
pub fn with_is_lieutenant(self, bits: bool) -> Self
Sets builder bits [3..=4].
Sourcepub fn checked_with_is_lieutenant(
self,
bits: bool,
) -> Result<Self, &'static str>
pub fn checked_with_is_lieutenant( self, bits: bool, ) -> Result<Self, &'static str>
Sets builder bits [3..=4]. Returns an error if the value is too big to fit within the field bits.
Sourcepub fn build(self) -> GroupMemberFlags
pub fn build(self) -> GroupMemberFlags
Builds a bitfield instance from the builder.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GroupMemberFlagsBuilder
impl RefUnwindSafe for GroupMemberFlagsBuilder
impl Send for GroupMemberFlagsBuilder
impl Sync for GroupMemberFlagsBuilder
impl Unpin for GroupMemberFlagsBuilder
impl UnwindSafe for GroupMemberFlagsBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more