Skip to main content

Or

Struct Or 

Source
pub struct Or<L, R> { /* private fields */ }
Expand description

Requires either predicate to return Cacheable.

Short-circuits: if the left predicate returns Cacheable, the right predicate is not evaluated.

Implementations§

Source§

impl<L, R> Or<L, R>

Source

pub fn new(left: L, right: R) -> Self

Creates a new Or combinator from two predicates.

Trait Implementations§

Source§

impl<L: Debug, R: Debug> Debug for Or<L, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<L, R> Predicate for Or<L, R>
where L: Predicate + Send + Sync, R: Predicate<Subject = L::Subject> + Send + Sync, L::Subject: Send,

Source§

type Subject = <L as Predicate>::Subject

The type being evaluated by this predicate.
Source§

fn check<'life0, 'async_trait>( &'life0 self, subject: Self::Subject, ) -> Pin<Box<dyn Future<Output = PredicateResult<Self::Subject>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Evaluate whether the subject should be cached. Read more

Auto Trait Implementations§

§

impl<L, R> Freeze for Or<L, R>
where L: Freeze, R: Freeze,

§

impl<L, R> RefUnwindSafe for Or<L, R>

§

impl<L, R> Send for Or<L, R>
where L: Send, R: Send,

§

impl<L, R> Sync for Or<L, R>
where L: Sync, R: Sync,

§

impl<L, R> Unpin for Or<L, R>
where L: Unpin, R: Unpin,

§

impl<L, R> UnwindSafe for Or<L, R>
where L: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PredicateExt for T
where T: Predicate,

Source§

fn and<R>(self, right: R) -> And<Self, R>
where R: Predicate<Subject = Self::Subject>,

Combines this predicate with another using AND logic. Read more
Source§

fn or<R>(self, right: R) -> Or<Self, R>
where R: Predicate<Subject = Self::Subject>,

Combines this predicate with another using OR logic. Read more
Source§

fn not(self) -> Not<Self>

Inverts this predicate’s result. Read more
Source§

fn boxed(self) -> Box<dyn Predicate<Subject = Self::Subject> + Send + Sync>
where Self: Send + Sync + 'static,

Boxes this predicate into a trait object. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.