pub struct CFStringCompareFlags { /* private fields */ }
Expand description
A CFOptionFlags
type for specifying options for string comparison .
Implementations§
Source§impl CFStringCompareFlags
impl CFStringCompareFlags
pub const DEFAULT: Self
Sourcepub const CASE_INSENSITIVE: Self
pub const CASE_INSENSITIVE: Self
Specifies that the comparison should ignore differences in case between alphabetical characters.
Sourcepub const BACKWARDS: Self
pub const BACKWARDS: Self
Specifies that the comparison should start at the last elements of the entities being compared (for example, strings or arrays).
Sourcepub const ANCHORED: Self
pub const ANCHORED: Self
Performs searching only on characters at the beginning or end of the range.
Sourcepub const NONLITERAL: Self
pub const NONLITERAL: Self
Specifies that loose equivalence is acceptable, especially as pertains to diacritical marks.
Sourcepub const LOCALIZED: Self
pub const LOCALIZED: Self
Specifies that the comparison should take into account differences related to locale, such as the thousands separator character.
Sourcepub const NUMERICALLY: Self
pub const NUMERICALLY: Self
Specifies that represented numeric values should be used as the basis for comparison and not the actual character values.
Sourcepub const DIACRITIC_INSENSITIVE: Self
pub const DIACRITIC_INSENSITIVE: Self
Specifies that the comparison should ignore diacritic markers.
Sourcepub const WIDTH_INSENSITIVE: Self
pub const WIDTH_INSENSITIVE: Self
Specifies that the comparison should ignore width differences.
Sourcepub const FORCED_ORDERING: Self
pub const FORCED_ORDERING: Self
Specifies that the comparison is forced to return either super::CFComparisonResult::KCFCompareLessThan
or super::CFComparisonResult::KCFCompareGreaterThan
if the strings are equivalent but not strictly equal.
Sourcepub const fn bits(&self) -> CFOptionFlags
pub const fn bits(&self) -> CFOptionFlags
Returns the raw value of the flags currently stored.
Sourcepub const fn from_bits(bits: CFOptionFlags) -> Option<Self>
pub const fn from_bits(bits: CFOptionFlags) -> Option<Self>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Sourcepub const fn from_bits_truncate(bits: CFOptionFlags) -> Self
pub const fn from_bits_truncate(bits: CFOptionFlags) -> Self
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: CFOptionFlags) -> Self
pub const unsafe fn from_bits_unchecked(bits: CFOptionFlags) -> Self
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
§Safety
The caller of the bitflags!
macro can chose to allow or
disallow extra bits for their bitflags type.
The caller of from_bits_unchecked()
has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
Sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Returns true
if there are flags common to both self
and other
.
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Returns true
if all of the flags in other
are contained within self
.
Sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Inserts or removes the specified flags depending on the passed value.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Returns the intersection between the flags in self
and
other
.
Specifically, the returned set contains only the flags which are
present in both self
and other
.
This is equivalent to using the &
operator (e.g.
ops::BitAnd
), as in flags & other
.
Sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
Returns the union of between the flags in self
and other
.
Specifically, the returned set contains all flags which are
present in either self
or other
, including any which are
present in both (see Self::symmetric_difference
if that
is undesirable).
This is equivalent to using the |
operator (e.g.
ops::BitOr
), as in flags | other
.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Returns the difference between the flags in self
and other
.
Specifically, the returned set contains all flags present in
self
, except for the ones present in other
.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other
(and this syntax is also supported).
This is equivalent to using the -
operator (e.g.
ops::Sub
), as in flags - other
.
Sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
Returns the symmetric difference between the flags
in self
and other
.
Specifically, the returned set contains the flags present which
are present in self
or other
, but that are not present in
both. Equivalently, it contains the flags present in exactly
one of the sets self
and other
.
This is equivalent to using the ^
operator (e.g.
ops::BitXor
), as in flags ^ other
.
Sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self
, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all()
and self
(e.g. Self::all() - self
)
This is equivalent to using the !
operator (e.g.
ops::Not
), as in !flags
.
Trait Implementations§
Source§impl Binary for CFStringCompareFlags
impl Binary for CFStringCompareFlags
Source§impl BitAnd for CFStringCompareFlags
impl BitAnd for CFStringCompareFlags
Source§impl BitAndAssign for CFStringCompareFlags
impl BitAndAssign for CFStringCompareFlags
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Disables all flags disabled in the set.
Source§impl BitOr for CFStringCompareFlags
impl BitOr for CFStringCompareFlags
Source§fn bitor(self, other: CFStringCompareFlags) -> Self
fn bitor(self, other: CFStringCompareFlags) -> Self
Returns the union of the two sets of flags.
Source§type Output = CFStringCompareFlags
type Output = CFStringCompareFlags
|
operator.Source§impl BitOrAssign for CFStringCompareFlags
impl BitOrAssign for CFStringCompareFlags
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Adds the set of flags.
Source§impl BitXor for CFStringCompareFlags
impl BitXor for CFStringCompareFlags
Source§impl BitXorAssign for CFStringCompareFlags
impl BitXorAssign for CFStringCompareFlags
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Toggles the set of flags.
Source§impl Clone for CFStringCompareFlags
impl Clone for CFStringCompareFlags
Source§fn clone(&self) -> CFStringCompareFlags
fn clone(&self) -> CFStringCompareFlags
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CFStringCompareFlags
impl Debug for CFStringCompareFlags
Source§impl Extend<CFStringCompareFlags> for CFStringCompareFlags
impl Extend<CFStringCompareFlags> for CFStringCompareFlags
Source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&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<CFStringCompareFlags> for CFStringCompareFlags
impl FromIterator<CFStringCompareFlags> for CFStringCompareFlags
Source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
Source§impl Hash for CFStringCompareFlags
impl Hash for CFStringCompareFlags
Source§impl LowerHex for CFStringCompareFlags
impl LowerHex for CFStringCompareFlags
Source§impl Not for CFStringCompareFlags
impl Not for CFStringCompareFlags
Source§impl Octal for CFStringCompareFlags
impl Octal for CFStringCompareFlags
Source§impl Ord for CFStringCompareFlags
impl Ord for CFStringCompareFlags
Source§fn cmp(&self, other: &CFStringCompareFlags) -> Ordering
fn cmp(&self, other: &CFStringCompareFlags) -> 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 CFStringCompareFlags
impl PartialEq for CFStringCompareFlags
Source§impl PartialOrd for CFStringCompareFlags
impl PartialOrd for CFStringCompareFlags
Source§impl Sub for CFStringCompareFlags
impl Sub for CFStringCompareFlags
Source§impl SubAssign for CFStringCompareFlags
impl SubAssign for CFStringCompareFlags
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Disables all flags enabled in the set.