Skip to main content

PredicateGroup

Trait PredicateGroup 

Source
pub trait PredicateGroup: Send + Sync {
    // Required method
    fn first_match<'life0, 'life1, 'async_trait>(
        &'life0 self,
        exchange: &'life1 Exchange,
    ) -> Pin<Box<dyn Future<Output = Result<Option<usize>, IndexedPredicateError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A group of predicates evaluated together in declaration order.

Required Methods§

Source

fn first_match<'life0, 'life1, 'async_trait>( &'life0 self, exchange: &'life1 Exchange, ) -> Pin<Box<dyn Future<Output = Result<Option<usize>, IndexedPredicateError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Evaluate predicates in declaration order and return the first match.

Ok(Some(i)) is the index of the first matching clause, Ok(None) means no clause matched, and Err(IndexedPredicateError) means clause i failed to evaluate. Clauses after a match, and skipped clauses, are never evaluated.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§