pub trait InputHandler<Input, Output, State>: Send + Sync{
// Required methods
fn name(&self) -> &str;
fn can_handle(&self, input: &Input) -> bool;
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
input: Input,
ctx: &'life1 mut SecretaryContext<State>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Output>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
输入处理器Trait
用于处理特定类型的用户输入。可以注册多个处理器来处理不同类型的输入。
Required Methods§
Sourcefn can_handle(&self, input: &Input) -> bool
fn can_handle(&self, input: &Input) -> bool
检查是否可以处理此输入