Skip to main content

Plugin

Trait Plugin 

Source
pub trait Plugin:
    Any
    + Send
    + Sync {
    // Required method
    fn name(&self) -> &'static str;

    // Provided methods
    fn on_plugin_load(&mut self, _config: Config) { ... }
    fn on_plugin_unload(&self) { ... }
}
Expand description

A plugin which allows you to add extra functionality to the REST client.

Required Methods§

Source

fn name(&self) -> &'static str

Get a name describing the Plugin.

Provided Methods§

Source

fn on_plugin_load(&mut self, _config: Config)

A callback fired immediately after the plugin is loaded. Usually used for initialization.

Source

fn on_plugin_unload(&self)

A callback fired immediately before the plugin is unloaded. Use this if you need to do any cleanup.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§