Skip to main content

SecretaryInput

Trait SecretaryInput 

Source
pub trait SecretaryInput:
    Send
    + Sync
    + Clone
    + Debug
    + Serialize
    + DeserializeOwned
    + 'static { }
Expand description

秘书输入消息Trait

所有发送给秘书的消息都需要实现这个trait。 这允许开发者定义自己的输入消息类型。

§示例

#[derive(Debug, Clone, Serialize, Deserialize)]
enum MyInput {
    TextMessage(String),
    VoiceCommand { audio_url: String },
    FileUpload { path: String, mime_type: String },
}

impl SecretaryInput for MyInput {}

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§

Source§

impl<T> SecretaryInput for T
where T: Send + Sync + Clone + Debug + Serialize + DeserializeOwned + 'static,

为所有满足约束的类型自动实现 SecretaryInput