pub struct Flags { /* private fields */ }Implementations§
Source§impl Flags
impl Flags
pub const ScrollBars: Flags
pub const SearchBar: Flags
pub const CheckBoxes: Flags
pub const AutoScroll: Flags
pub const HighlightSelectedItemWhenInactive: Flags
pub const None: Flags
Sourcepub fn from_value(value: u8) -> Option<Self>
pub fn from_value(value: u8) -> Option<Self>
This function allows creating a new Flags object from an u8 value.
This method returns Some(Flags) if the parameter value is a valid bit configuration, or None otherwise.
§Example
use EnumBitFlags::EnumBitFlags;
#[EnumBitFlags]
enum MyFlags {
Flag_1 = 0x0001,
Flag_2 = 0x0002,
Flag_3 = 0x0004
}
if let Some(y) = MyFlags::from_value(5) {
println!("{y}");
}
else {
eprintln!("Could not create value!");
}Sourcepub fn contains_one(&self, mask: Flags) -> bool
pub fn contains_one(&self, mask: Flags) -> bool
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Checks if the current value is not set or if disable_empty_generation is false and the object is the empty value
§Returns
trueif the current value is not set or is the empty value.falseotherwise.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears the value or sets it to the empty value.
§Returns
trueif the current value is not set or is the empty value.falseotherwise.
Sourcepub fn remove(&mut self, mask: Flags)
pub fn remove(&mut self, mask: Flags)
Removes the values set in the mask parameter from the current value.
§Parameters
mask: AFlagsvalue representing the mask to remove.
Trait Implementations§
Source§impl BitAndAssign for Flags
impl BitAndAssign for Flags
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&= operation. Read moreSource§impl BitOrAssign for Flags
impl BitOrAssign for Flags
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|= operation. Read moreimpl Copy for Flags
impl Eq for Flags
Auto Trait Implementations§
impl Freeze for Flags
impl RefUnwindSafe for Flags
impl Send for Flags
impl Sync for Flags
impl Unpin for Flags
impl UnsafeUnpin for Flags
impl UnwindSafe for Flags
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.