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§
Sourcefn execute(
&mut self,
input: Self::Input,
) -> impl Future<Output = Result<Self::Output, Self::Error>> + Send
fn execute( &mut self, input: Self::Input, ) -> impl Future<Output = Result<Self::Output, Self::Error>> + Send
执行输入并返回结果
Sourcefn status(&self) -> ExecutorStatus
fn status(&self) -> ExecutorStatus
获取执行器状态
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.