pub enum Promise<T, E>where
T: Unpin,
E: PromiseRejection,{
Pending(BoxedPromiseFuture<T, E>),
Resolved(T),
Rejected(E),
Consumed,
}Variants§
Implementations§
Source§impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
Source§impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
pub const fn is_consumed(&self) -> bool
Source§impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
pub const fn is_pending(&self) -> bool
Source§impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
Source§impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
pub const fn is_rejected(&self) -> bool
Source§impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
pub const fn is_resolved(&self) -> bool
Source§impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
Source§impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
Source§impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
Sourcepub fn pending_sync(&mut self) -> bool
pub fn pending_sync(&mut self) -> bool
Polls the promise’s inner future using a no-op waker.
Returns true if the promise is still pending.
Source§impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
Source§impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
Source§impl<T, E> Promise<T, E>
impl<T, E> Promise<T, E>
pub fn race<I>(promises: I) -> Selfwhere
I: IntoIterator<Item = Self>,
Source§impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
Source§impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
Sourcepub fn ready_sync(&mut self) -> bool
pub fn ready_sync(&mut self) -> bool
Polls the promise’s inner future using a no-op waker.
Returns true if the promise is now resolved or rejected.
Source§impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
Source§impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
impl<T, E> Promise<T, E>where
T: Unpin,
E: PromiseRejection,
Trait Implementations§
Auto Trait Implementations§
impl<T, E> Freeze for Promise<T, E>
impl<T, E> !RefUnwindSafe for Promise<T, E>
impl<T, E> Send for Promise<T, E>where
T: Send,
impl<T, E> !Sync for Promise<T, E>
impl<T, E> Unpin for Promise<T, E>
impl<T, E> UnsafeUnpin for Promise<T, E>where
T: UnsafeUnpin,
E: UnsafeUnpin,
impl<T, E> !UnwindSafe for Promise<T, E>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more