pub trait PluginMessage {
// Required method
fn send_message_to_frontend_typed(
&self,
content: &str,
message_type: MessageType,
) -> bool;
// Provided methods
fn send_message_to_frontend(&self, content: &str) -> bool { ... }
fn send_success_message(&self, content: &str) -> bool { ... }
fn send_error_message(&self, content: &str) -> bool { ... }
fn send_warning_message(&self, content: &str) -> bool { ... }
fn send_info_message(&self, content: &str) -> bool { ... }
}
Expand description
插件消息发送器
Required Methods§
Sourcefn send_message_to_frontend_typed(
&self,
content: &str,
message_type: MessageType,
) -> bool
fn send_message_to_frontend_typed( &self, content: &str, message_type: MessageType, ) -> bool
向前端发送带类型的消息
Provided Methods§
Sourcefn send_message_to_frontend(&self, content: &str) -> bool
fn send_message_to_frontend(&self, content: &str) -> bool
向前端发送消息(新协议)
Sourcefn send_success_message(&self, content: &str) -> bool
fn send_success_message(&self, content: &str) -> bool
向前端发送成功消息
Sourcefn send_error_message(&self, content: &str) -> bool
fn send_error_message(&self, content: &str) -> bool
向前端发送错误消息
Sourcefn send_warning_message(&self, content: &str) -> bool
fn send_warning_message(&self, content: &str) -> bool
向前端发送警告消息
Sourcefn send_info_message(&self, content: &str) -> bool
fn send_info_message(&self, content: &str) -> bool
向前端发送信息消息