pub struct TouchBuilder<'a> { /* private fields */ }Expand description
Builds and executes a “touch” action.
A touch can be a simple tap or a long press, depending on the duration.
This struct is created by the Droid::touch() method.
Implementations§
Source§impl<'a> TouchBuilder<'a>
impl<'a> TouchBuilder<'a>
pub fn new(droid: &'a mut Droid, target: Target) -> Self
Sourcepub fn times(self, count: u32) -> Self
pub fn times(self, count: u32) -> Self
Sets the number of times to perform the touch action.
Default is 1.
Sourcepub fn duration(self, duration: Duration) -> Self
pub fn duration(self, duration: Duration) -> Self
Sets the duration of the touch.
A short duration (e.g., < 200ms) is a tap. A longer duration is a long press.
Default is 100ms.
Sourcepub fn threshold(self, value: f32) -> Self
pub fn threshold(self, value: f32) -> Self
Sets the confidence threshold for image matching.
This only applies if the target is an Image.
The value should be between 0.0 and 1.0.
If not set, the default confidence from DroidConfig is used.
Sourcepub fn search_in(self, rect: RelativeRect) -> Self
pub fn search_in(self, rect: RelativeRect) -> Self
Restricts the image search to a specific region of the screen.
This only applies if the target is an Image.
The rect is defined using relative coordinates (0.0 to 1.0).
Auto Trait Implementations§
impl<'a> Freeze for TouchBuilder<'a>
impl<'a> RefUnwindSafe for TouchBuilder<'a>
impl<'a> Send for TouchBuilder<'a>
impl<'a> Sync for TouchBuilder<'a>
impl<'a> Unpin for TouchBuilder<'a>
impl<'a> !UnwindSafe for TouchBuilder<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.