pub struct ButtonMask(/* private fields */);Expand description
Set of pointer buttons a gesture recognizer is configured to fire
for. Used by the four click-style recognizers (TapRecognizer,
DoubleTapRecognizer, TripleTapRecognizer, LongPressRecognizer)
and the matching widget-level builders (accept_tap_buttons, …).
Default for every recognizer is ButtonMask::PRIMARY — left-click
only — which matches the user’s expectation for a “tap” and keeps
right-click free to open a context menu without spuriously
activating the widget. Use ButtonMask::ALL or a hand-built
PRIMARY | SECONDARY etc. to opt into broader button sets.
Implementations§
Source§impl ButtonMask
impl ButtonMask
Sourcepub const ALL: Self
pub const ALL: Self
All buttons currently representable by PointerButton.
Sourcepub const fn contains(self, button: PointerButton) -> bool
pub const fn contains(self, button: PointerButton) -> bool
true when the mask contains the given button.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Intersection — accept only buttons present in both masks.
Trait Implementations§
Source§impl BitAnd for ButtonMask
impl BitAnd for ButtonMask
Source§impl BitAndAssign for ButtonMask
impl BitAndAssign for ButtonMask
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&= operation. Read moreSource§impl BitOr for ButtonMask
impl BitOr for ButtonMask
Source§impl BitOrAssign for ButtonMask
impl BitOrAssign for ButtonMask
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|= operation. Read moreSource§impl Clone for ButtonMask
impl Clone for ButtonMask
Source§fn clone(&self) -> ButtonMask
fn clone(&self) -> ButtonMask
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ButtonMask
Source§impl Debug for ButtonMask
impl Debug for ButtonMask
Source§impl Default for ButtonMask
impl Default for ButtonMask
impl Eq for ButtonMask
Source§impl From<PointerButton> for ButtonMask
impl From<PointerButton> for ButtonMask
Source§fn from(button: PointerButton) -> Self
fn from(button: PointerButton) -> Self
Converts to this type from the input type.
Source§impl<const N: usize> From<[PointerButton; N]> for ButtonMask
impl<const N: usize> From<[PointerButton; N]> for ButtonMask
Source§fn from(buttons: [PointerButton; N]) -> Self
fn from(buttons: [PointerButton; N]) -> Self
Converts to this type from the input type.
Source§impl Hash for ButtonMask
impl Hash for ButtonMask
Source§impl PartialEq for ButtonMask
impl PartialEq for ButtonMask
impl StructuralPartialEq for ButtonMask
Auto Trait Implementations§
impl Freeze for ButtonMask
impl RefUnwindSafe for ButtonMask
impl Send for ButtonMask
impl Sync for ButtonMask
impl Unpin for ButtonMask
impl UnsafeUnpin for ButtonMask
impl UnwindSafe for ButtonMask
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