Skip to main content

Capability

Trait Capability 

Source
pub trait Capability: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn is_available(&self, context: &ExecutionContext) -> bool;
    fn execute<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        context: &'life1 mut ExecutionContext,
        parameters: &'life2 HashMap<String, Value>,
    ) -> Pin<Box<dyn Future<Output = Result<CapabilityResult, CapabilityError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Capability Trait

Represents a capability that a BPMN element can provide. Capabilities define what an element can do, allowing for flexible composition.

Required Methods§

Source

fn name(&self) -> &str

Get the capability name

Source

fn is_available(&self, context: &ExecutionContext) -> bool

Check if this capability is available in the given context

Source

fn execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, context: &'life1 mut ExecutionContext, parameters: &'life2 HashMap<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<CapabilityResult, CapabilityError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Execute the capability

§Arguments
  • context - Execution context
  • parameters - Capability-specific parameters
§Returns
  • Ok(CapabilityResult) - Capability execution result
  • Err(CapabilityError) - Capability execution error

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§