1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use std::sync::Arc; use crate::Promise; use super::super::{state::GateState, GatedPromise}; impl<T, E> GatedPromise<T, E> { /// Wraps `promise`. The first poll always reaches the wrapped promise. pub fn new(promise: Promise<T, E>) -> Self { Self { inner: promise, state: Arc::new(GateState::new()), } } }