pub trait MangoFetchPlugin: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn name(&self) -> &str;
fn version(&self) -> &str;
fn initialize(&mut self, host: Arc<dyn PluginHost>) -> Result<()>;
fn handle_command(
&self,
command: String,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'static>>;
fn commands(&self) -> Vec<String>;
// Provided method
fn shutdown(&self) { ... }
}Required Methods§
fn id(&self) -> &str
fn name(&self) -> &str
fn version(&self) -> &str
fn initialize(&mut self, host: Arc<dyn PluginHost>) -> Result<()>
fn handle_command( &self, command: String, args: Value, ) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'static>>
fn commands(&self) -> Vec<String>
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".