Skip to main content

ReadyBoolExt

Trait ReadyBoolExt 

Source
pub trait ReadyBoolExt
where Self: Future<Output = bool> + ReadyEqExt<bool> + Send,
{ // Provided methods fn is_false(self) -> impl Future<Output = bool> + Send { ... } fn is_true(self) -> impl Future<Output = bool> + Send { ... } }
Expand description

Tests the Boolean output of a future without awaiting it early.

The helpers attach equality comparisons to the future. Each returned future resolves to the requested truth-state test.

Provided Methods§

Source

fn is_false(self) -> impl Future<Output = bool> + Send

Reports whether the future resolves to false.

The receiver is consumed, then its output is compared with false after completion.

Source

fn is_true(self) -> impl Future<Output = bool> + Send

Reports whether the future resolves to true.

The receiver is consumed, then its output is compared with true after completion.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<Fut> ReadyBoolExt for Fut
where Fut: Future<Output = bool> + Send,