Struct capnp::capability::Promise
source · [−]pub struct Promise<T, E> { /* private fields */ }
Expand description
A computation that might eventually resolve to a value of type T
or to an error
of type E
. Dropping the promise cancels the computation.
Implementations
sourceimpl<T, E> Promise<T, E>
impl<T, E> Promise<T, E>
pub fn ok(value: T) -> Promise<T, E>ⓘNotable traits for Promise<T, E>impl<T, E> Future for Promise<T, E> type Output = Result<T, E>;
pub fn err(error: E) -> Promise<T, E>ⓘNotable traits for Promise<T, E>impl<T, E> Future for Promise<T, E> type Output = Result<T, E>;
pub fn from_future<F>(f: F) -> Promise<T, E>ⓘNotable traits for Promise<T, E>impl<T, E> Future for Promise<T, E> type Output = Result<T, E>;
where
F: Future<Output = Result<T, E>> + 'static,
Trait Implementations
Auto Trait Implementations
impl<T, E> !RefUnwindSafe for Promise<T, E>
impl<T, E> !Send for Promise<T, E>
impl<T, E> !Sync for Promise<T, E>
impl<T, E> Unpin for Promise<T, E>
impl<T, E> !UnwindSafe for Promise<T, E>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<F> IntoFuture for F where
F: Future,
impl<F> IntoFuture for F where
F: Future,
type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
sourcefn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more