pub struct OptionFlags { /* private fields */ }
Implementations§
Source§impl OptionFlags
impl OptionFlags
pub const NONE: OptionFlags
pub const HIDDEN: OptionFlags
pub const IN_MAIN: OptionFlags
pub const REVERSE: OptionFlags
pub const NO_ARG: OptionFlags
pub const FILENAME: OptionFlags
pub const OPTIONAL_ARG: OptionFlags
pub const NOALIAS: OptionFlags
Sourcepub const fn empty() -> OptionFlags
pub const fn empty() -> OptionFlags
Returns an empty set of flags
Sourcepub const fn all() -> OptionFlags
pub const fn all() -> OptionFlags
Returns the set containing all flags.
Sourcepub fn from_bits(bits: u32) -> Option<OptionFlags>
pub fn from_bits(bits: u32) -> Option<OptionFlags>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Sourcepub const fn from_bits_truncate(bits: u32) -> OptionFlags
pub const fn from_bits_truncate(bits: u32) -> OptionFlags
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> OptionFlags
pub const unsafe fn from_bits_unchecked(bits: u32) -> OptionFlags
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Sourcepub const fn intersects(&self, other: OptionFlags) -> bool
pub const fn intersects(&self, other: OptionFlags) -> bool
Returns true
if there are flags common to both self
and other
.
Sourcepub const fn contains(&self, other: OptionFlags) -> bool
pub const fn contains(&self, other: OptionFlags) -> bool
Returns true
all of the flags in other
are contained within self
.
Sourcepub fn insert(&mut self, other: OptionFlags)
pub fn insert(&mut self, other: OptionFlags)
Inserts the specified flags in-place.
Sourcepub fn remove(&mut self, other: OptionFlags)
pub fn remove(&mut self, other: OptionFlags)
Removes the specified flags in-place.
Sourcepub fn toggle(&mut self, other: OptionFlags)
pub fn toggle(&mut self, other: OptionFlags)
Toggles the specified flags in-place.
Sourcepub fn set(&mut self, other: OptionFlags, value: bool)
pub fn set(&mut self, other: OptionFlags, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations§
Source§impl Binary for OptionFlags
impl Binary for OptionFlags
Source§impl BitAnd for OptionFlags
impl BitAnd for OptionFlags
Source§fn bitand(self, other: OptionFlags) -> OptionFlags
fn bitand(self, other: OptionFlags) -> OptionFlags
Returns the intersection between the two sets of flags.
Source§type Output = OptionFlags
type Output = OptionFlags
&
operator.Source§impl BitAndAssign for OptionFlags
impl BitAndAssign for OptionFlags
Source§fn bitand_assign(&mut self, other: OptionFlags)
fn bitand_assign(&mut self, other: OptionFlags)
Disables all flags disabled in the set.
Source§impl BitOr for OptionFlags
impl BitOr for OptionFlags
Source§fn bitor(self, other: OptionFlags) -> OptionFlags
fn bitor(self, other: OptionFlags) -> OptionFlags
Returns the union of the two sets of flags.
Source§type Output = OptionFlags
type Output = OptionFlags
|
operator.Source§impl BitOrAssign for OptionFlags
impl BitOrAssign for OptionFlags
Source§fn bitor_assign(&mut self, other: OptionFlags)
fn bitor_assign(&mut self, other: OptionFlags)
Adds the set of flags.
Source§impl BitXor for OptionFlags
impl BitXor for OptionFlags
Source§fn bitxor(self, other: OptionFlags) -> OptionFlags
fn bitxor(self, other: OptionFlags) -> OptionFlags
Returns the left flags, but with all the right flags toggled.
Source§type Output = OptionFlags
type Output = OptionFlags
^
operator.Source§impl BitXorAssign for OptionFlags
impl BitXorAssign for OptionFlags
Source§fn bitxor_assign(&mut self, other: OptionFlags)
fn bitxor_assign(&mut self, other: OptionFlags)
Toggles the set of flags.
Source§impl Clone for OptionFlags
impl Clone for OptionFlags
Source§fn clone(&self) -> OptionFlags
fn clone(&self) -> OptionFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for OptionFlags
impl Debug for OptionFlags
Source§impl Extend<OptionFlags> for OptionFlags
impl Extend<OptionFlags> for OptionFlags
Source§fn extend<T: IntoIterator<Item = OptionFlags>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = OptionFlags>>(&mut self, iterator: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl FromIterator<OptionFlags> for OptionFlags
impl FromIterator<OptionFlags> for OptionFlags
Source§fn from_iter<T: IntoIterator<Item = OptionFlags>>(iterator: T) -> OptionFlags
fn from_iter<T: IntoIterator<Item = OptionFlags>>(iterator: T) -> OptionFlags
Source§impl Hash for OptionFlags
impl Hash for OptionFlags
Source§impl LowerHex for OptionFlags
impl LowerHex for OptionFlags
Source§impl Not for OptionFlags
impl Not for OptionFlags
Source§fn not(self) -> OptionFlags
fn not(self) -> OptionFlags
Returns the complement of this set of flags.
Source§type Output = OptionFlags
type Output = OptionFlags
!
operator.Source§impl Octal for OptionFlags
impl Octal for OptionFlags
Source§impl Ord for OptionFlags
impl Ord for OptionFlags
Source§fn cmp(&self, other: &OptionFlags) -> Ordering
fn cmp(&self, other: &OptionFlags) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for OptionFlags
impl PartialEq for OptionFlags
Source§impl PartialOrd for OptionFlags
impl PartialOrd for OptionFlags
Source§impl Sub for OptionFlags
impl Sub for OptionFlags
Source§fn sub(self, other: OptionFlags) -> OptionFlags
fn sub(self, other: OptionFlags) -> OptionFlags
Returns the set difference of the two sets of flags.
Source§type Output = OptionFlags
type Output = OptionFlags
-
operator.Source§impl SubAssign for OptionFlags
impl SubAssign for OptionFlags
Source§fn sub_assign(&mut self, other: OptionFlags)
fn sub_assign(&mut self, other: OptionFlags)
Disables all flags enabled in the set.