Skip to main content

Plugin

Trait Plugin 

Source
pub trait Plugin: Default + 'static {
Show 16 methods // Required method fn info() -> PluginInfo; // Provided methods fn start(&mut self) { ... } fn stop(&mut self) { ... } fn on_event(&mut self, _event: Event) { ... } fn pre_send(&mut self, _message: OutgoingMessage) -> SendDecision { ... } fn pre_edit(&mut self, _edit: OutgoingEdit) -> SendDecision { ... } fn message_accessories(&mut self, _message: Message) -> Vec<Element> { ... } fn message_decorations(&mut self, _message: Message) -> Vec<Element> { ... } fn message_popover_buttons( &mut self, _message: Message, ) -> Vec<PopoverButton> { ... } fn chat_bar_buttons( &mut self, _context: ChatBarContext, ) -> Vec<ChatBarButton> { ... } fn context_menu(&mut self, _target: MenuTarget) -> Vec<MenuItem> { ... } fn profile_sections(&mut self, _context: ProfileContext) -> Vec<Element> { ... } fn user_badges(&mut self, _context: ProfileContext) -> Vec<Badge> { ... } fn member_decorations(&mut self, _context: MemberContext) -> Vec<Element> { ... } fn server_list_elements(&mut self) -> Vec<Element> { ... } fn settings_panel(&mut self) -> Option<Element> { ... }
}
Expand description

A PhoenixCord plugin.

The host creates the plugin with Default when it is enabled and drops it when it is disabled. Every hook has an empty default, so implement only the hooks listed in PluginInfo::hooks. The meaning of each hook is documented on the matching function of the plugin interface in phoenixcord.wit.

Required Methods§

Source

fn info() -> PluginInfo

Static metadata, read once when the plugin is loaded.

Provided Methods§

Source

fn start(&mut self)

Source

fn stop(&mut self)

Source

fn on_event(&mut self, _event: Event)

Source

fn pre_send(&mut self, _message: OutgoingMessage) -> SendDecision

Source

fn pre_edit(&mut self, _edit: OutgoingEdit) -> SendDecision

Source

fn message_accessories(&mut self, _message: Message) -> Vec<Element>

Source

fn message_decorations(&mut self, _message: Message) -> Vec<Element>

Source

fn message_popover_buttons(&mut self, _message: Message) -> Vec<PopoverButton>

Source

fn chat_bar_buttons(&mut self, _context: ChatBarContext) -> Vec<ChatBarButton>

Source

fn context_menu(&mut self, _target: MenuTarget) -> Vec<MenuItem>

Source

fn profile_sections(&mut self, _context: ProfileContext) -> Vec<Element>

Source

fn user_badges(&mut self, _context: ProfileContext) -> Vec<Badge>

Source

fn member_decorations(&mut self, _context: MemberContext) -> Vec<Element>

Source

fn server_list_elements(&mut self) -> Vec<Element>

Source

fn settings_panel(&mut self) -> Option<Element>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§