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
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.
Trait Implementations§
Source§impl Clone for InteractionSource
impl Clone for InteractionSource
Source§fn clone(&self) -> InteractionSource
fn clone(&self) -> InteractionSource
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 moreAuto 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