pub trait Plugin: Sized {
// Required method
fn init(weechat: &Weechat, args: Args) -> Result<Self, ()>;
}Expand description
Weechat plugin trait.
Implement this trait over your struct to implement a Weechat plugin. The init method will get called when Weechat loads the plugin, while the
Drop method will be called when Weechat unloads the plugin.
Required Methods§
Sourcefn init(weechat: &Weechat, args: Args) -> Result<Self, ()>
fn init(weechat: &Weechat, args: Args) -> Result<Self, ()>
The initialization method for the plugin.
This will be called when Weechat loads the pluign.
§Arguments
-
weechat- A borrow to a Weechat object that will be valid during the duration of the init callback. -
args- Arguments passed to the plugin when it is loaded.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.