VanguardPlugin

Trait VanguardPlugin 

Source
pub trait VanguardPlugin:
    Send
    + Sync
    + Debug {
    // Required methods
    fn metadata(&self) -> &PluginMetadata;
    fn validate<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ValidationResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn initialize<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn cleanup<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn is_compatible_with(&self, vanguard_version: &Version) -> bool { ... }
    fn config_schema(&self) -> Option<Value> { ... }
}
Expand description

Trait that must be implemented by all Vanguard plugins

Required Methods§

Source

fn metadata(&self) -> &PluginMetadata

Get the plugin’s metadata

Source

fn validate<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ValidationResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Validate the plugin’s configuration and environment

Source

fn initialize<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initialize the plugin

Source

fn cleanup<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Clean up plugin resources

Provided Methods§

Source

fn is_compatible_with(&self, vanguard_version: &Version) -> bool

Check if plugin is compatible with given Vanguard version

Source

fn config_schema(&self) -> Option<Value>

Get plugin configuration schema

Implementors§