Trait PluginMessage

Source
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§

Source

fn send_message_to_frontend_typed( &self, content: &str, message_type: MessageType, ) -> bool

向前端发送带类型的消息

Provided Methods§

Source

fn send_message_to_frontend(&self, content: &str) -> bool

向前端发送消息(新协议)

Source

fn send_success_message(&self, content: &str) -> bool

向前端发送成功消息

Source

fn send_error_message(&self, content: &str) -> bool

向前端发送错误消息

Source

fn send_warning_message(&self, content: &str) -> bool

向前端发送警告消息

Source

fn send_info_message(&self, content: &str) -> bool

向前端发送信息消息

Implementors§