tuwunel_core/utils/future/ready_bool_ext.rs
1#![expect(clippy::wrong_self_convention)]
2
3use futures::Future;
4
5use super::ReadyEqExt;
6
7pub trait ReadyBoolExt
8where
9 Self: Future<Output = bool> + ReadyEqExt<bool> + Send,
10{
11 #[inline]
12 fn is_false(self) -> impl Future<Output = bool> + Send { self.eq(&false) }
13
14 #[inline]
15 fn is_true(self) -> impl Future<Output = bool> + Send { self.eq(&true) }
16}
17
18impl<Fut> ReadyBoolExt for Fut where Fut: Future<Output = bool> + Send {}