pub struct MutableInteractionSource { /* private fields */ }Implementations§
Source§impl MutableInteractionSource
impl MutableInteractionSource
pub fn new() -> Self
pub fn with_runtime(runtime: RuntimeHandle) -> Self
pub fn id(&self) -> u64
pub fn press(&self, press_position: Point) -> PressInteractionPress
pub fn release(&self, press: PressInteractionPress)
pub fn cancel(&self, press: PressInteractionPress)
pub fn emit(&self, interaction: Interaction)
Sourcepub fn collectIsPressedAsState(&self) -> State<bool>
pub fn collectIsPressedAsState(&self) -> State<bool>
Returns whether the interaction source is currently pressed as a
reactive State.
Mirrors Jetpack Compose: InteractionSource.collectIsPressedAsState().
The value flips to true when a PressInteraction::Press is emitted
and back to false once every active press has seen a matching
PressInteraction::Release or PressInteraction::Cancel. Reading the
returned state inside a composable subscribes the enclosing recompose
scope, so the composable recomposes whenever the pressed state changes.
pub fn collectLastInteractionAsState(&self) -> State<Option<Interaction>>
Trait Implementations§
Source§impl Clone for MutableInteractionSource
impl Clone for MutableInteractionSource
Source§fn clone(&self) -> MutableInteractionSource
fn clone(&self) -> MutableInteractionSource
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 moreSource§impl Debug for MutableInteractionSource
impl Debug for MutableInteractionSource
Source§impl Default for MutableInteractionSource
impl Default for MutableInteractionSource
impl Eq for MutableInteractionSource
Auto Trait Implementations§
impl !RefUnwindSafe for MutableInteractionSource
impl !Send for MutableInteractionSource
impl !Sync for MutableInteractionSource
impl !UnwindSafe for MutableInteractionSource
impl Freeze for MutableInteractionSource
impl Unpin for MutableInteractionSource
impl UnsafeUnpin for MutableInteractionSource
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