ps-promise 0.1.0-17

Promise-like owned futures
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod implementations;
mod methods;

use std::{sync::Arc, task::Waker};

use crate::PromiseRejection;

use super::state::SharedState;

/// A cloneable, multi-consumer handle to a [`crate::Promise`], created by [`crate::Promise::shared`].
pub struct SharedPromise<T, E>
where
    E: PromiseRejection,
{
    pub(super) state: Arc<SharedState<T, E>>,
    pub(super) waker: Waker,
    pub(super) waiter_id: usize,
}