Skip to main content

CompositionRule

Trait CompositionRule 

Source
pub trait CompositionRule: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn description(&self) -> &str;
    fn applies_to(&self, capabilities: &[Capability]) -> bool;
    fn compose<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        capabilities: &'life1 [Capability],
        context: &'life2 CompositionContext,
    ) -> Pin<Box<dyn Future<Output = Result<CompositionResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait for capability composition rules

Composition rules analyze a set of capabilities and detect:

  • Additive compositions (summed capabilities)
  • Emergent compositions (new capabilities from combinations)
  • Redundant compositions (reliability from redundancy)
  • Constraint compositions (team limits from individual constraints)

Required Methods§

Source

fn name(&self) -> &str

Human-readable name for this rule

Source

fn description(&self) -> &str

Description of what this rule detects

Source

fn applies_to(&self, capabilities: &[Capability]) -> bool

Check if this rule applies to the given set of capabilities

Rules should return true if they can meaningfully compose any of the provided capabilities.

Source

fn compose<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, capabilities: &'life1 [Capability], context: &'life2 CompositionContext, ) -> Pin<Box<dyn Future<Output = Result<CompositionResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Apply the composition rule to a set of capabilities

Returns composed capabilities with confidence scores and references to contributing capabilities.

Implementors§