Skip to main content

ps_promise/methods/
ready_sync.rs

1use crate::{Promise, PromiseRejection};
2
3impl<T, E> Promise<T, E>
4where
5    T: Unpin,
6    E: PromiseRejection,
7{
8    /// Polls the promise's inner future using a no-op waker.
9    /// Returns `true` if the promise is now resolved or rejected.
10    pub fn ready_sync(&mut self) -> bool {
11        self.poll_sync();
12
13        self.is_ready()
14    }
15}