pub struct Executor {
pub kind: ExecutorType,
pub context: Context,
}Expand description
Executor that is responsible for executing the program’s commands.
It uses the given Context to store and retrieve values during runtime.
It takes an ExecutableCommand_ which contains subjects and properties that will be passed to the callback function of the associated command’s routine.
§Example:
let executor = Executor::former().form();
let executable_command = ExecutableCommand_
{
subjects : vec![ Value::String( "subject_value".to_string() ), /* ... */ ],
properties : HashMap::from_iter
([
( "prop_name".to_string(), Value::Number( 42.0 ) ),
/* ... */
]),
routine : Routine::new( |( args, props )| Ok( () ) )
};
assert!( executor.command( executable_command ).is_ok() );Fields§
§kind: ExecutorTypeRepresents how the executor will work
context: ContextThe default context for the executor
Implementations§
source§impl Executor
impl Executor
sourcepub fn program(
&self,
program: Program<Namespace<ExecutableCommand_>>
) -> Result<()>
pub fn program( &self, program: Program<Namespace<ExecutableCommand_>> ) -> Result<()>
Executes a program
Setup runtimes for each namespace into program and run it with specified execution type
sourcepub fn namespace(&self, namespace: Namespace<ExecutableCommand_>) -> Result<()>
pub fn namespace(&self, namespace: Namespace<ExecutableCommand_>) -> Result<()>
Executes a namespace
Configure Runtime and run commands from namespace at runtime position while it isn’t finished
sourcepub fn command(&self, command: ExecutableCommand_) -> Result<()>
pub fn command(&self, command: ExecutableCommand_) -> Result<()>
Executes a command
Call command callback with context if it is necessary.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Executor
impl !Send for Executor
impl !Sync for Executor
impl Unpin for Executor
impl !UnwindSafe for Executor
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