pub trait RepliableEvent {
// Required methods
fn reply_builder<M>(&self, msg: M, auto_escape: bool) -> SendApi
where M: Into<OneBotMessage>;
fn reply<T>(&self, msg: T)
where KoviMessage: From<T>,
T: Serialize;
fn reply_and_quote<T>(&self, msg: T)
where KoviMessage: From<T>,
T: Serialize;
fn get_text(&self) -> String;
fn get_sender_nickname(&self) -> String;
fn borrow_text(&self) -> Option<&str>;
}Expand description
满足此 trait 即可被回复
Required Methods§
fn reply_builder<M>(&self, msg: M, auto_escape: bool) -> SendApiwhere
M: Into<OneBotMessage>,
Sourcefn reply_and_quote<T>(&self, msg: T)
fn reply_and_quote<T>(&self, msg: T)
快速回复消息并且引用
Sourcefn get_sender_nickname(&self) -> String
fn get_sender_nickname(&self) -> String
便捷获取发送者昵称,如果无名字,此处为空字符串
Sourcefn borrow_text(&self) -> Option<&str>
fn borrow_text(&self) -> Option<&str>
借用 event 的 text,只是做了一下self.text.as_deref()的包装
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".