pub struct TargetShapeFilter(/* private fields */);Expand description
Bitmask that specifies what shapes are targeted by an action.
Implementations§
Source§impl TargetShapeFilter
impl TargetShapeFilter
Sourcepub const NONE: TargetShapeFilter
pub const NONE: TargetShapeFilter
Match no shapes.
Sourcepub const ALL: TargetShapeFilter
pub const ALL: TargetShapeFilter
Match all shapes.
Sourcepub const CHAR: TargetShapeFilter
pub const CHAR: TargetShapeFilter
Match TargetShape::CharWise.
Sourcepub const LINE: TargetShapeFilter
pub const LINE: TargetShapeFilter
Match TargetShape::LineWise.
Sourcepub const BLOCK: TargetShapeFilter
pub const BLOCK: TargetShapeFilter
Match TargetShape::BlockWise.
Source§impl TargetShapeFilter
impl TargetShapeFilter
Sourcepub const fn empty() -> TargetShapeFilter
pub const fn empty() -> TargetShapeFilter
Get a flags value with all bits unset.
Sourcepub const fn all() -> TargetShapeFilter
pub const fn all() -> TargetShapeFilter
Get a flags value with all known bits set.
Sourcepub const fn bits(&self) -> u32
pub const fn bits(&self) -> u32
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: u32) -> Option<TargetShapeFilter>
pub const fn from_bits(bits: u32) -> Option<TargetShapeFilter>
Convert from a bits value.
This method will return None if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u32) -> TargetShapeFilter
pub const fn from_bits_truncate(bits: u32) -> TargetShapeFilter
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u32) -> TargetShapeFilter
pub const fn from_bits_retain(bits: u32) -> TargetShapeFilter
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<TargetShapeFilter>
pub fn from_name(name: &str) -> Option<TargetShapeFilter>
Get a flags value with the bits of a flag with the given name set.
This method will return None if name is empty or doesn’t
correspond to any named flag.
Sourcepub const fn intersects(&self, other: TargetShapeFilter) -> bool
pub const fn intersects(&self, other: TargetShapeFilter) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: TargetShapeFilter) -> bool
pub const fn contains(&self, other: TargetShapeFilter) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn insert(&mut self, other: TargetShapeFilter)
pub fn insert(&mut self, other: TargetShapeFilter)
The bitwise or (|) of the bits in two flags values.
Sourcepub fn remove(&mut self, other: TargetShapeFilter)
pub fn remove(&mut self, other: TargetShapeFilter)
The intersection of a source flags value with the complement of a target flags
value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
remove won’t truncate other, but the ! operator will.
Sourcepub fn toggle(&mut self, other: TargetShapeFilter)
pub fn toggle(&mut self, other: TargetShapeFilter)
The bitwise exclusive-or (^) of the bits in two flags values.
Sourcepub fn set(&mut self, other: TargetShapeFilter, value: bool)
pub fn set(&mut self, other: TargetShapeFilter, value: bool)
Call insert when value is true or remove when value is false.
Sourcepub const fn intersection(self, other: TargetShapeFilter) -> TargetShapeFilter
pub const fn intersection(self, other: TargetShapeFilter) -> TargetShapeFilter
The bitwise and (&) of the bits in two flags values.
Sourcepub const fn union(self, other: TargetShapeFilter) -> TargetShapeFilter
pub const fn union(self, other: TargetShapeFilter) -> TargetShapeFilter
The bitwise or (|) of the bits in two flags values.
Sourcepub const fn difference(self, other: TargetShapeFilter) -> TargetShapeFilter
pub const fn difference(self, other: TargetShapeFilter) -> TargetShapeFilter
The intersection of a source flags value with the complement of a target flags
value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Sourcepub const fn symmetric_difference(
self,
other: TargetShapeFilter,
) -> TargetShapeFilter
pub const fn symmetric_difference( self, other: TargetShapeFilter, ) -> TargetShapeFilter
The bitwise exclusive-or (^) of the bits in two flags values.
Sourcepub const fn complement(self) -> TargetShapeFilter
pub const fn complement(self) -> TargetShapeFilter
The bitwise negation (!) of the bits in a flags value, truncating the result.
Source§impl TargetShapeFilter
impl TargetShapeFilter
Sourcepub const fn iter(&self) -> Iter<TargetShapeFilter>
pub const fn iter(&self) -> Iter<TargetShapeFilter>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
Sourcepub const fn iter_names(&self) -> IterNames<TargetShapeFilter>
pub const fn iter_names(&self) -> IterNames<TargetShapeFilter>
Yield a set of contained named flags values.
This method is like iter, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Source§impl TargetShapeFilter
impl TargetShapeFilter
Sourcepub fn matches(&self, shape: &TargetShape) -> bool
pub fn matches(&self, shape: &TargetShape) -> bool
Check whether this filter applies to a given TargetShape.
Trait Implementations§
Source§impl Binary for TargetShapeFilter
impl Binary for TargetShapeFilter
Source§impl BitAnd for TargetShapeFilter
impl BitAnd for TargetShapeFilter
Source§fn bitand(self, other: TargetShapeFilter) -> TargetShapeFilter
fn bitand(self, other: TargetShapeFilter) -> TargetShapeFilter
The bitwise and (&) of the bits in two flags values.
Source§type Output = TargetShapeFilter
type Output = TargetShapeFilter
& operator.Source§impl BitAndAssign for TargetShapeFilter
impl BitAndAssign for TargetShapeFilter
Source§fn bitand_assign(&mut self, other: TargetShapeFilter)
fn bitand_assign(&mut self, other: TargetShapeFilter)
The bitwise and (&) of the bits in two flags values.
Source§impl BitOr for TargetShapeFilter
impl BitOr for TargetShapeFilter
Source§fn bitor(self, other: TargetShapeFilter) -> TargetShapeFilter
fn bitor(self, other: TargetShapeFilter) -> TargetShapeFilter
The bitwise or (|) of the bits in two flags values.
Source§type Output = TargetShapeFilter
type Output = TargetShapeFilter
| operator.Source§impl BitOrAssign for TargetShapeFilter
impl BitOrAssign for TargetShapeFilter
Source§fn bitor_assign(&mut self, other: TargetShapeFilter)
fn bitor_assign(&mut self, other: TargetShapeFilter)
The bitwise or (|) of the bits in two flags values.
Source§impl BitXor for TargetShapeFilter
impl BitXor for TargetShapeFilter
Source§fn bitxor(self, other: TargetShapeFilter) -> TargetShapeFilter
fn bitxor(self, other: TargetShapeFilter) -> TargetShapeFilter
The bitwise exclusive-or (^) of the bits in two flags values.
Source§type Output = TargetShapeFilter
type Output = TargetShapeFilter
^ operator.Source§impl BitXorAssign for TargetShapeFilter
impl BitXorAssign for TargetShapeFilter
Source§fn bitxor_assign(&mut self, other: TargetShapeFilter)
fn bitxor_assign(&mut self, other: TargetShapeFilter)
The bitwise exclusive-or (^) of the bits in two flags values.
Source§impl Clone for TargetShapeFilter
impl Clone for TargetShapeFilter
Source§fn clone(&self) -> TargetShapeFilter
fn clone(&self) -> TargetShapeFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TargetShapeFilter
impl Debug for TargetShapeFilter
Source§impl Extend<TargetShapeFilter> for TargetShapeFilter
impl Extend<TargetShapeFilter> for TargetShapeFilter
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = TargetShapeFilter>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = TargetShapeFilter>,
The bitwise or (|) of the bits in each flags value.
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 Flags for TargetShapeFilter
impl Flags for TargetShapeFilter
Source§const FLAGS: &'static [Flag<TargetShapeFilter>]
const FLAGS: &'static [Flag<TargetShapeFilter>]
Source§fn from_bits_retain(bits: u32) -> TargetShapeFilter
fn from_bits_retain(bits: u32) -> TargetShapeFilter
Source§fn known_bits(&self) -> Self::Bits
fn known_bits(&self) -> Self::Bits
Source§fn unknown_bits(&self) -> Self::Bits
fn unknown_bits(&self) -> Self::Bits
Source§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true if any unknown bits are set.Source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
Source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
Source§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
Source§fn iter_defined_names() -> IterDefinedNames<Self>
fn iter_defined_names() -> IterDefinedNames<Self>
Self::FLAGS.Source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|) of the bits in two flags values.Source§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!). Read moreSource§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^) of the bits in two flags values.Source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&) of the bits in two flags values.Source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!). Read moreSource§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in two flags values.Source§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in a flags value, truncating the result.Source§impl From<TargetShape> for TargetShapeFilter
impl From<TargetShape> for TargetShapeFilter
Source§fn from(shape: TargetShape) -> TargetShapeFilter
fn from(shape: TargetShape) -> TargetShapeFilter
Source§impl FromIterator<TargetShapeFilter> for TargetShapeFilter
impl FromIterator<TargetShapeFilter> for TargetShapeFilter
Source§fn from_iter<T>(iterator: T) -> TargetShapeFilterwhere
T: IntoIterator<Item = TargetShapeFilter>,
fn from_iter<T>(iterator: T) -> TargetShapeFilterwhere
T: IntoIterator<Item = TargetShapeFilter>,
The bitwise or (|) of the bits in each flags value.
Source§impl IntoIterator for TargetShapeFilter
impl IntoIterator for TargetShapeFilter
Source§type Item = TargetShapeFilter
type Item = TargetShapeFilter
Source§type IntoIter = Iter<TargetShapeFilter>
type IntoIter = Iter<TargetShapeFilter>
Source§fn into_iter(self) -> <TargetShapeFilter as IntoIterator>::IntoIter
fn into_iter(self) -> <TargetShapeFilter as IntoIterator>::IntoIter
Source§impl LowerHex for TargetShapeFilter
impl LowerHex for TargetShapeFilter
Source§impl Not for TargetShapeFilter
impl Not for TargetShapeFilter
Source§fn not(self) -> TargetShapeFilter
fn not(self) -> TargetShapeFilter
The bitwise negation (!) of the bits in a flags value, truncating the result.
Source§type Output = TargetShapeFilter
type Output = TargetShapeFilter
! operator.Source§impl Octal for TargetShapeFilter
impl Octal for TargetShapeFilter
Source§impl PartialEq for TargetShapeFilter
impl PartialEq for TargetShapeFilter
Source§impl Sub for TargetShapeFilter
impl Sub for TargetShapeFilter
Source§fn sub(self, other: TargetShapeFilter) -> TargetShapeFilter
fn sub(self, other: TargetShapeFilter) -> TargetShapeFilter
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Source§type Output = TargetShapeFilter
type Output = TargetShapeFilter
- operator.Source§impl SubAssign for TargetShapeFilter
impl SubAssign for TargetShapeFilter
Source§fn sub_assign(&mut self, other: TargetShapeFilter)
fn sub_assign(&mut self, other: TargetShapeFilter)
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.