Struct coroutines::promise::Promise [] [src]

pub struct Promise<T: Send + 'static> { /* fields omitted */ }

A representation of a "suspended" coroutine.

Methods

impl<T: Send + 'static> Promise<T>
[src]

[src]

Suspends the execution of the current coroutine, calls the provided function with a Promise representing the current coroutine, and waits until the Promise gets resolved.

If the Promise is dropped before resolving, Drop will panic and the coroutine will leak.

If called outside of a coroutine, the current thread will be suspended instead.

[src]

Resolves a Promise with the provided result.

Trait Implementations

impl<T: Send + 'static> Send for Promise<T>
[src]

impl<T: Send + 'static> Drop for Promise<T>
[src]

[src]

Executes the destructor for this type. Read more