Skip to main content

Executor

Struct Executor 

Source
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>

Source

pub fn new(desktop: D) -> Self

Source

pub fn mount(&mut self, anchors: Vec<AnchorDef>) -> Result<(), AutomataError>

Register anchor definitions.

Source

pub fn unmount(&mut self, names: &[&str])

Unmount anchors by name.

Source

pub fn cleanup_depth(&mut self, depth: usize)

Clean up DOM anchors at depth.

Source

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).

Source

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>
where <D as Desktop>::Elem: Send,

§

impl<D> Sync for Executor<D>
where D: Sync, <D as Desktop>::Elem: Sync,

§

impl<D> Unpin for Executor<D>
where D: Unpin, <D as Desktop>::Elem: Unpin,

§

impl<D> UnsafeUnpin for Executor<D>
where D: UnsafeUnpin,

§

impl<D> UnwindSafe for Executor<D>
where D: UnwindSafe, <D as Desktop>::Elem: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.