pub trait CpiExtension: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn provider_type(&self) -> &str;
fn list_actions(&self) -> Vec<String>;
fn get_action_definition(&self, action: &str) -> Option<ActionDefinition>;
fn execute_action(
&self,
action: &str,
params: &HashMap<String, Value>,
) -> ActionResult;
// Provided methods
fn default_settings(&self) -> HashMap<String, Value> { ... }
fn test_install(&self) -> ActionResult { ... }
fn version(&self) -> String { ... }
}Expand description
Main trait that must be implemented by CPI extensions
Required Methods§
Sourcefn provider_type(&self) -> &str
fn provider_type(&self) -> &str
Returns the provider type
Sourcefn list_actions(&self) -> Vec<String>
fn list_actions(&self) -> Vec<String>
Returns all available actions
Sourcefn get_action_definition(&self, action: &str) -> Option<ActionDefinition>
fn get_action_definition(&self, action: &str) -> Option<ActionDefinition>
Returns the definition of a specific action
Sourcefn execute_action(
&self,
action: &str,
params: &HashMap<String, Value>,
) -> ActionResult
fn execute_action( &self, action: &str, params: &HashMap<String, Value>, ) -> ActionResult
Executes an action with the given parameters
Provided Methods§
Sourcefn default_settings(&self) -> HashMap<String, Value>
fn default_settings(&self) -> HashMap<String, Value>
Optional method that returns default parameter values for the provider
Sourcefn test_install(&self) -> ActionResult
fn test_install(&self) -> ActionResult
Test if the extension is properly installed
fn version(&self) -> String
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".