pub struct CompositionEngine { /* private fields */ }Expand description
Composition engine that manages and applies composition rules
Implementations§
Source§impl CompositionEngine
impl CompositionEngine
Sourcepub fn register_rule(&mut self, rule: Arc<dyn CompositionRule>)
pub fn register_rule(&mut self, rule: Arc<dyn CompositionRule>)
Register a composition rule
Rules are applied in registration order during composition.
Sourcepub fn rule_count(&self) -> usize
pub fn rule_count(&self) -> usize
Get the number of registered rules
Sourcepub async fn compose(
&self,
capabilities: &[Capability],
context: &CompositionContext,
) -> Result<Vec<CompositionResult>>
pub async fn compose( &self, capabilities: &[Capability], context: &CompositionContext, ) -> Result<Vec<CompositionResult>>
Compose capabilities using all applicable rules
Applies each registered rule to the input capabilities and aggregates all detected compositions.
Sourcepub async fn compose_all(
&self,
capabilities: &[Capability],
context: &CompositionContext,
) -> Result<Vec<Capability>>
pub async fn compose_all( &self, capabilities: &[Capability], context: &CompositionContext, ) -> Result<Vec<Capability>>
Compose capabilities and flatten into a single list
This is a convenience method that applies all rules and returns all composed capabilities in a flat list.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompositionEngine
impl !RefUnwindSafe for CompositionEngine
impl Send for CompositionEngine
impl Sync for CompositionEngine
impl Unpin for CompositionEngine
impl UnsafeUnpin for CompositionEngine
impl !UnwindSafe for CompositionEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more