pub struct Settings {
pub relocate: bool,
pub verify: Verify,
pub space: Space,
pub settle_ms: u64,
pub timeout_ms: u64,
pub poll_ms: u64,
pub failsafe: bool,
pub failsafe_margin: f64,
pub audit: bool,
}Expand description
Run-wide settings. Every field has a defensible default so a minimal flow file is three lines.
Fields§
§relocate: boolRe-locate regions against a fresh capture before acting, and act on the corrected coordinates.
verify: VerifyHow thoroughly to verify.
space: SpaceCoordinate space to resolve into. Auto is what the platform’s
input API wants and is almost always right.
settle_ms: u64Milliseconds to settle between steps. Not a substitute for verification — the OS accepts an event long before an app has finished reacting to it.
timeout_ms: u64How long a wait_for / wait_gone step may poll before it fails.
poll_ms: u64Milliseconds between polls while waiting. Each poll is a screen capture, so this is a real cost, not a formality.
failsafe: boolAbort the run if the cursor is found in a screen corner before a step. The kill switch: grabbing the mouse is what a person does when automation goes wrong, and a corner needs no aim. On by default — turning it off means nothing but the watchdog can stop a run from the outside.
failsafe_margin: f64How close to a corner counts, in the input space’s own units.
audit: boolAppend what this run did to the audit log.
On by default. Opt-in would defeat the purpose — the first
unattended run is exactly the one that would have no record. The
file is local, append-only, and never contains typed text; see
crate::audit.
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn validate(&self) -> Result<(), FlowError>
pub fn validate(&self) -> Result<(), FlowError>
Refuse a combination that cannot do what it says.
On Settings rather than in Flow::parse because a flow file is
not the only way settings arrive — the line protocol’s hello
carries them too, and a rule enforced on one path is a rule with a
hole in it.