Skip to main content

Plugin

Trait Plugin 

Source
pub trait Plugin:
    Bot
    + Send
    + Sync
    + 'static {
    const NAME: &'static str;
}
Expand description

A set of handlers that a bot runs in its own task, with a name.

The #[plugin] attribute implements this trait. Implement it yourself only for a plugin that you make without the attribute.

Required Associated Constants§

Source

const NAME: &'static str

The name of the plugin. It starts with a lowercase ASCII letter, and has only lowercase ASCII letters, digits and _. It cannot be sqlite or start with sqlite_.

A plugin that keeps data uses this name as its store namespace.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§