pub enum Step {
Click {
target: String,
},
DoubleClick {
target: String,
},
Type {
text: String,
},
Key {
chord: String,
},
Drag {
from: String,
to: String,
},
Scroll {
target: String,
amount: i32,
axis: Axis,
},
Verify {
target: String,
},
WaitFor {
target: String,
},
WaitGone {
target: String,
},
Pause {
ms: u64,
},
}Expand description
What a step does.
Variants§
Click
Click the resolved point of a labeled region.
DoubleClick
Double-click the resolved point of a labeled region.
Type
Type literal text through the platform’s Unicode path — layout
independent, and unable to express shortcuts (use key).
Key
Press a chord of physical keys, e.g. cmd+s.
Drag
Press at one region’s point, move, release at another’s.
Scroll
Hover a region and turn the wheel over it.
target picks what to scroll — a wheel event goes to whatever
is under the cursor — and resolves exactly like a click’s does.
amount is the one quantity in this tool that is not
exact: it counts 15° wheel clicks, and how far that moves depends
on the reader’s own OS scroll-speed setting. Scroll until
something is visible (wait_for), never a fixed distance.
Verify
Confirm a labeled region still matches its saved crop.
WaitFor
Poll until a labeled region matches its saved crop again, or the timeout expires. The honest alternative to guessing with a sleep: the OS accepts an event long before an app finishes reacting.
WaitGone
Poll until a labeled region STOPS matching — “wait until this spinner goes away”, “wait until the button changes state”.
Pause
Wait a fixed duration. Present because some waits genuinely have no observable, and pretending otherwise would push people to sleep-and-hope outside the tool.
Implementations§
Source§impl Step
impl Step
Sourcepub fn targets(&self) -> Vec<&str>
pub fn targets(&self) -> Vec<&str>
Every session label this step needs. Resolution fails before any action runs when one is missing.
Sourcepub fn injects(&self) -> bool
pub fn injects(&self) -> bool
Whether this step posts input, as opposed to only looking at the screen.
The distinction decides which regions must be present before a
run starts. Acting on a region whose position cannot be trusted
clicks an unknown thing; looking for one that is absent is the
entire job of wait_for.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Step
impl<'de> Deserialize<'de> for Step
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Step
impl StructuralPartialEq for Step
Auto Trait Implementations§
impl Freeze for Step
impl RefUnwindSafe for Step
impl Send for Step
impl Sync for Step
impl Unpin for Step
impl UnsafeUnpin for Step
impl UnwindSafe for Step
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.