pub struct Executor<D: Desktop> {
pub dom: ShadowDom<D>,
pub desktop: D,
pub global_handlers: Vec<RecoveryHandler>,
}Expand description
Runs plans against a live UIA desktop.
Owns the ShadowDom (element handle cache) and the desktop. Global recovery
handlers fire for every plan; plan-local handlers fire only within their plan.
Fields§
§dom: ShadowDom<D>§desktop: D§global_handlers: Vec<RecoveryHandler>Implementations§
Source§impl<D: Desktop> Executor<D>
impl<D: Desktop> Executor<D>
pub fn new(desktop: D) -> Self
Sourcepub fn mount(&mut self, anchors: Vec<AnchorDef>) -> Result<(), AutomataError>
pub fn mount(&mut self, anchors: Vec<AnchorDef>) -> Result<(), AutomataError>
Register anchor definitions.
Sourcepub fn cleanup_depth(&mut self, depth: usize)
pub fn cleanup_depth(&mut self, depth: usize)
Clean up DOM anchors at depth.
Sourcepub fn run(
&mut self,
plan: &Plan<'_>,
state: &mut WorkflowState,
) -> Result<(), AutomataError>
pub fn run( &mut self, plan: &Plan<'_>, state: &mut WorkflowState, ) -> Result<(), AutomataError>
Run all steps of a plan in order.
Anchors listed in plan.unmount are always removed after the plan
completes, whether it succeeds or fails (guaranteed cleanup).
Sourcepub fn eval_condition(
&mut self,
cond: &Condition,
locals: &HashMap<String, String>,
params: &HashMap<String, String>,
output: &Output,
) -> Result<bool, AutomataError>
pub fn eval_condition( &mut self, cond: &Condition, locals: &HashMap<String, String>, params: &HashMap<String, String>, output: &Output, ) -> Result<bool, AutomataError>
Evaluate a condition against the current DOM state. Used by WorkflowFile::run()
for phase-level preconditions before mounting anchors.
Auto Trait Implementations§
impl<D> Freeze for Executor<D>where
D: Freeze,
impl<D> RefUnwindSafe for Executor<D>
impl<D> Send for Executor<D>
impl<D> Sync for Executor<D>
impl<D> Unpin for Executor<D>
impl<D> UnsafeUnpin for Executor<D>where
D: UnsafeUnpin,
impl<D> UnwindSafe for Executor<D>
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