Skip to main content

ReadyEqExt

Trait ReadyEqExt 

Source
pub trait ReadyEqExt<T>
where Self: Future<Output = T> + Send + Sized, T: PartialEq + Send + Sync,
{ // Required methods fn eq(self, t: &T) -> impl Future<Output = bool> + Send; fn ne(self, t: &T) -> impl Future<Output = bool> + Send; }
Expand description

Compares a future’s output with a borrowed value.

The comparison is attached to the future and runs when it resolves. Both equality and inequality forms preserve asynchronous composition.

Required Methods§

Source

fn eq(self, t: &T) -> impl Future<Output = bool> + Send

Tests whether the future’s output equals t.

The comparison borrows the supplied value until the returned future completes. The output value is consumed after comparison.

Source

fn ne(self, t: &T) -> impl Future<Output = bool> + Send

Tests whether the future’s output differs from t.

The comparison borrows the supplied value until the returned future completes. The output value is consumed after comparison.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<Fut, T> ReadyEqExt<T> for Fut
where Fut: Future<Output = T> + Send + Sized, T: PartialEq + Send + Sync,