Trait orchestrator::executor::AddExecutor
source · pub trait AddExecutor<Input: ExecutorState, Out: ExecutorState> {
// Required methods
fn add_executor<F, E, Data>(
&mut self,
f: fn(_: Input, _: Data) -> F,
data: Data,
) -> impl Future<Output = Result<(), Box<dyn StdError + Send + Sync + 'static>>>
where F: Future<Output = Result<Out, E>> + 'static + Send + Sync,
E: Into<Box<dyn StdError + Send + Sync>>,
Data: Serialize + for<'a> Deserialize<'a> + 'static;
fn enable_executor_typed<Data: Serialize>(
&mut self,
i: &Input,
o: &Out,
data: Data,
) -> impl Future<Output = Result<(), Error>>;
}Expand description
Add Executor Trait
Required Methods§
sourcefn add_executor<F, E, Data>(
&mut self,
f: fn(_: Input, _: Data) -> F,
data: Data,
) -> impl Future<Output = Result<(), Box<dyn StdError + Send + Sync + 'static>>>
fn add_executor<F, E, Data>( &mut self, f: fn(_: Input, _: Data) -> F, data: Data, ) -> impl Future<Output = Result<(), Box<dyn StdError + Send + Sync + 'static>>>
method used to register an executor:
it also checks if the executor does work. In order to do that it create the default Input, and then call’s the function. If it works adds it to the executor register.
Object Safety§
This trait is not object safe.