Trait Executor

Source
pub trait Executor {
    type Input;
    type Output;
    type Error;

    // Required methods
    fn execute(
        &mut self,
        input: Self::Input,
    ) -> impl Future<Output = Result<Self::Output, Self::Error>> + Send;
    fn status(&self) -> ExecutorStatus;
    fn stop(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send;
}
Expand description

执行器接口 - 所有执行器都必须实现这个接口

Required Associated Types§

Required Methods§

Source

fn execute( &mut self, input: Self::Input, ) -> impl Future<Output = Result<Self::Output, Self::Error>> + Send

执行输入并返回结果

Source

fn status(&self) -> ExecutorStatus

获取执行器状态

Source

fn stop(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send

停止执行器

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§