pub enum Interaction {
Mouse(Mouse),
Keyboard(Keyboard),
}Expand description
A user interaction.
Variants§
Implementations§
Source§impl Interaction
impl Interaction
Sourcepub fn from_event(event: &Event) -> Option<Self>
pub fn from_event(event: &Event) -> Option<Self>
Creates an Interaction from a runtime Event.
This can be useful for recording tests during real usage.
Sourcepub fn merge(self, next: Self) -> (Self, Option<Self>)
pub fn merge(self, next: Self) -> (Self, Option<Self>)
Merges two interactions together, if possible.
This method can turn certain sequences of interactions into a single one. For instance, a mouse movement, left button press, and left button release can all be merged into a single click interaction.
Merging is lossy and, therefore, it is not always desirable if you are recording a test and want full reproducibility.
If the interactions cannot be merged, the next interaction will be
returned as the second element of the tuple.
Trait Implementations§
Source§impl Clone for Interaction
impl Clone for Interaction
Source§fn clone(&self) -> Interaction
fn clone(&self) -> Interaction
Returns a duplicate of the value. Read more
1.0.0 · 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 Interaction
impl Debug for Interaction
Source§impl Display for Interaction
impl Display for Interaction
Source§impl PartialEq for Interaction
impl PartialEq for Interaction
impl StructuralPartialEq for Interaction
Auto Trait Implementations§
impl Freeze for Interaction
impl RefUnwindSafe for Interaction
impl Send for Interaction
impl Sync for Interaction
impl Unpin for Interaction
impl UnsafeUnpin for Interaction
impl UnwindSafe for Interaction
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