pub trait BoolExt{
// Required methods
fn or<B>(self, b: B) -> impl Future<Output = bool> + Send
where B: Future<Output = bool> + Send + Unpin,
Self: Sized + Unpin;
fn and<B>(self, b: B) -> impl Future<Output = bool> + Send
where B: Future<Output = bool> + Send,
Self: Sized;
fn and2<B, C>(self, b: B, c: C) -> impl Future<Output = bool> + Send
where B: Future<Output = bool> + Send,
C: Future<Output = bool> + Send,
Self: Sized;
fn and3<B, C, D>(
self,
b: B,
c: C,
d: D,
) -> impl Future<Output = bool> + Send
where B: Future<Output = bool> + Send,
C: Future<Output = bool> + Send,
D: Future<Output = bool> + Send,
Self: Sized;
}Expand description
Combines Boolean futures with concurrent short-circuit logic.
Conjunction resolves false on the first false output and true only after every input resolves true. Disjunction resolves true on the first true output and false only after every input resolves false.
Required Methods§
Sourcefn or<B>(self, b: B) -> impl Future<Output = bool> + Send
fn or<B>(self, b: B) -> impl Future<Output = bool> + Send
Computes the disjunction of two Boolean futures.
Both futures are polled concurrently. The returned future resolves true on the first true output or false after both produce false.
Sourcefn and<B>(self, b: B) -> impl Future<Output = bool> + Send
fn and<B>(self, b: B) -> impl Future<Output = bool> + Send
Computes the conjunction of two Boolean futures.
Both futures are polled concurrently. The returned future resolves false on the first false output or true after both produce true.
Sourcefn and2<B, C>(self, b: B, c: C) -> impl Future<Output = bool> + Send
fn and2<B, C>(self, b: B, c: C) -> impl Future<Output = bool> + Send
Computes the conjunction of three Boolean futures.
The receiver and both arguments are polled concurrently. The result is true only when all three futures produce true.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".