Skip to main content

BoxedAsyncSpecification

Struct BoxedAsyncSpecification 

Source
pub struct BoxedAsyncSpecification<T: ?Sized + Sync, Error: Send> { /* private fields */ }
Expand description

An explicitly type-erased asynchronous specification.

This is the object-safe boundary for AsyncSpecification. Construction requires Send + Sync + 'static; the adapter allocates one boxed future per evaluation, while static async composition keeps its concrete future type.

Implementations§

Source§

impl<T: ?Sized + Sync, Error: Send> BoxedAsyncSpecification<T, Error>

Source

pub fn new<Concrete>(specification: Concrete) -> Self
where Concrete: AsyncSpecification<T, Error = Error> + Send + Sync + 'static,

Erases and owns a Send + Sync asynchronous specification.

Trait Implementations§

Source§

impl<T: ?Sized + Sync, Error: Send> AsyncSpecification<T> for BoxedAsyncSpecification<T, Error>

Source§

type Error = Error

The typed error produced by asynchronous evaluation.
Source§

fn is_satisfied_by<'candidate>( &'candidate self, candidate: &'candidate T, ) -> impl Future<Output = Result<bool, Self::Error>> + Send + 'candidate

Evaluates the rule and returns a Send future with a typed result.
Source§

fn and<Other>(self, other: Other) -> AsyncAnd<Self, Other>
where Self: Sized, Other: AsyncSpecification<T, Error = Self::Error>,

Combines this rule with other using asynchronous short-circuiting AND.
Source§

fn or<Other>(self, other: Other) -> AsyncOr<Self, Other>
where Self: Sized, Other: AsyncSpecification<T, Error = Self::Error>,

Combines this rule with other using asynchronous short-circuiting OR.
Source§

fn not(self) -> AsyncNot<Self>
where Self: Sized,

Creates an asynchronous rule that negates this rule’s result.

Auto Trait Implementations§

§

impl<T, Error> !RefUnwindSafe for BoxedAsyncSpecification<T, Error>

§

impl<T, Error> !UnwindSafe for BoxedAsyncSpecification<T, Error>

§

impl<T, Error> Freeze for BoxedAsyncSpecification<T, Error>
where T: ?Sized,

§

impl<T, Error> Send for BoxedAsyncSpecification<T, Error>
where T: ?Sized,

§

impl<T, Error> Sync for BoxedAsyncSpecification<T, Error>
where T: ?Sized,

§

impl<T, Error> Unpin for BoxedAsyncSpecification<T, Error>
where T: ?Sized,

§

impl<T, Error> UnsafeUnpin for BoxedAsyncSpecification<T, Error>
where T: ?Sized,

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, 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.