pub trait Provider: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn version(&self) -> &str;
fn features(&self) -> Vec<String>;
fn feature_operations(&self, feature: &str) -> ProviderResult<Vec<String>>;
fn execute_operation(
&self,
feature: &str,
operation: &str,
args: HashMap<String, Value>,
context: &dyn ProviderContext,
) -> ProviderResult<Value>;
fn initialize(
&mut self,
context: &dyn ProviderContext,
) -> ProviderResult<()>;
fn shutdown(&mut self, context: &dyn ProviderContext) -> ProviderResult<()>;
// Provided method
fn supports_feature(&self, feature: &str) -> bool { ... }
}
Expand description
Provider capability trait
Required Methods§
Sourcefn feature_operations(&self, feature: &str) -> ProviderResult<Vec<String>>
fn feature_operations(&self, feature: &str) -> ProviderResult<Vec<String>>
Get operations for a feature
Sourcefn execute_operation(
&self,
feature: &str,
operation: &str,
args: HashMap<String, Value>,
context: &dyn ProviderContext,
) -> ProviderResult<Value>
fn execute_operation( &self, feature: &str, operation: &str, args: HashMap<String, Value>, context: &dyn ProviderContext, ) -> ProviderResult<Value>
Execute an operation
Sourcefn initialize(&mut self, context: &dyn ProviderContext) -> ProviderResult<()>
fn initialize(&mut self, context: &dyn ProviderContext) -> ProviderResult<()>
Initialize provider
Sourcefn shutdown(&mut self, context: &dyn ProviderContext) -> ProviderResult<()>
fn shutdown(&mut self, context: &dyn ProviderContext) -> ProviderResult<()>
Shutdown provider
Provided Methods§
Sourcefn supports_feature(&self, feature: &str) -> bool
fn supports_feature(&self, feature: &str) -> bool
Check if provider supports a feature