pub struct InteractionSource { /* private fields */ }Expand description
Read-only handle to a shared interaction state.
Use MutableInteractionSource::source to obtain a read handle, or
MutableInteractionSource::new + .source() to create a new source pair.
Multiple clones share the same underlying state.
Implementations§
Source§impl InteractionSource
impl InteractionSource
pub fn collect_is_pressed(&self) -> bool
pub fn collect_is_hovered(&self) -> bool
pub fn collect_is_focused(&self) -> bool
Sourcepub fn collect_is_focus_visible(&self) -> bool
pub fn collect_is_focus_visible(&self) -> bool
Focused and keyboard/D-pad input mode (Compose :focus-visible).
pub fn collect_is_dragged(&self) -> bool
pub fn collect_last_press_position(&self) -> Option<Vec2>
pub fn collect_last_press_id(&self) -> Option<PressId>
Sourcepub fn to_mutable(&self) -> MutableInteractionSource
pub fn to_mutable(&self) -> MutableInteractionSource
Get a mutable handle to the same underlying state.
Both handles share the same Rc<RefCell<..>>, so mutations via
the returned MutableInteractionSource are reflected here.
Sourcepub fn reset_hover(&self)
pub fn reset_hover(&self)
Convenience: clear hover only via read handle (same Rc).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for InteractionSource
impl !Send for InteractionSource
impl !Sync for InteractionSource
impl !UnwindSafe for InteractionSource
impl Freeze for InteractionSource
impl Unpin for InteractionSource
impl UnsafeUnpin for InteractionSource
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