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§
Sourcefn metadata(&self) -> &PluginMetadata
fn metadata(&self) -> &PluginMetadata
Get the plugin’s metadata
Sourcefn validate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ValidationResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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
Provided Methods§
Sourcefn is_compatible_with(&self, vanguard_version: &Version) -> bool
fn is_compatible_with(&self, vanguard_version: &Version) -> bool
Check if plugin is compatible with given Vanguard version
Sourcefn config_schema(&self) -> Option<Value>
fn config_schema(&self) -> Option<Value>
Get plugin configuration schema