Skip to main content

SecretaryOutput

Trait SecretaryOutput 

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

秘书输出消息Trait

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

§示例

#[derive(Debug, Clone, Serialize, Deserialize)]
enum MyOutput {
    TextReply(String),
    ActionRequired { action: String, options: Vec<String> },
    Notification { level: String, message: String },
}

impl SecretaryOutput for MyOutput {}

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> SecretaryOutput for T
where T: Send + Sync + Clone + Debug + Serialize + DeserializeOwned + 'static,

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