StatefulPredicateBooleanOperations

Trait StatefulPredicateBooleanOperations 

Source
pub trait StatefulPredicateBooleanOperations<C, S, F>: Fn(Arc<C>, Arc<S>) -> F
where F: Future<Output = bool> + Send, C: Send + Sync + 'static, S: Send + Sync + 'static, Self: Sized + Send + Sync + 'static,
{ // Provided methods fn and<P, PF>( self, other: P, ) -> Box<dyn Fn(Arc<C>, Arc<S>) -> BoxFuture<'static, bool> + Send + Sync + 'static> where P: StatefulPredicateBooleanOperations<C, S, PF> + 'static, PF: Future<Output = bool> + Send { ... } fn or<P, PF>( self, other: P, ) -> Box<dyn Fn(Arc<C>, Arc<S>) -> BoxFuture<'static, bool> + Send + Sync + 'static> where P: StatefulPredicateBooleanOperations<C, S, PF> + 'static, PF: Future<Output = bool> + Send { ... } fn xor<P, PF>( self, other: P, ) -> Box<dyn Fn(Arc<C>, Arc<S>) -> BoxFuture<'static, bool> + Send + Sync + 'static> where P: StatefulPredicateBooleanOperations<C, S, PF> + 'static, PF: Future<Output = bool> + Send { ... } fn not( self, ) -> Box<dyn Fn(Arc<C>, Arc<S>) -> BoxFuture<'static, bool> + Send + Sync + 'static> { ... } }
Expand description

Boolean operations on stateful predicates.

Provided Methods§

Source

fn and<P, PF>( self, other: P, ) -> Box<dyn Fn(Arc<C>, Arc<S>) -> BoxFuture<'static, bool> + Send + Sync + 'static>
where P: StatefulPredicateBooleanOperations<C, S, PF> + 'static, PF: Future<Output = bool> + Send,

self(..).await && other(..).await

Source

fn or<P, PF>( self, other: P, ) -> Box<dyn Fn(Arc<C>, Arc<S>) -> BoxFuture<'static, bool> + Send + Sync + 'static>
where P: StatefulPredicateBooleanOperations<C, S, PF> + 'static, PF: Future<Output = bool> + Send,

self(..).await || other(..).await

Source

fn xor<P, PF>( self, other: P, ) -> Box<dyn Fn(Arc<C>, Arc<S>) -> BoxFuture<'static, bool> + Send + Sync + 'static>
where P: StatefulPredicateBooleanOperations<C, S, PF> + 'static, PF: Future<Output = bool> + Send,

self(..).await != other(..).await

Source

fn not( self, ) -> Box<dyn Fn(Arc<C>, Arc<S>) -> BoxFuture<'static, bool> + Send + Sync + 'static>

!self(..).await

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<C, S, F, T> StatefulPredicateBooleanOperations<C, S, F> for T
where T: Fn(Arc<C>, Arc<S>) -> F + Sized + Send + Sync + 'static, F: Future<Output = bool> + Send, C: Send + Sync + 'static, S: Send + Sync + 'static,