Struct futures_util::future::RemoteHandle
source · [−]pub struct RemoteHandle<T> { /* private fields */ }
Expand description
The handle to a remote future returned by
remote_handle
. When you drop this,
the remote future will be woken up to be dropped by the executor.
Unwind safety
When the remote future panics, Remote will catch the unwind and transfer it to
the thread where RemoteHandle
is being awaited. This is good for the common
case where Remote is spawned on a threadpool. It is unlikely that other code
in the executor working thread shares mutable data with the spawned future and we
preserve the executor from losing its working threads.
If you run the future locally and send the handle of to be awaited elsewhere, you must be careful with regard to unwind safety because the thread in which the future is polled will keep running after the panic and the thread running the RemoteHandle will unwind.
Implementations
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for RemoteHandle<T>
impl<T> Send for RemoteHandle<T> where
T: Send,
impl<T> Sync for RemoteHandle<T> where
T: Send,
impl<T> Unpin for RemoteHandle<T>
impl<T> !UnwindSafe for RemoteHandle<T>
Blanket Implementations
Mutably borrows from an owned value. Read more
into_future
)The output that the future will produce on completion.
type Future = F
type Future = F
into_future
)Which kind of future are we turning this into?
into_future
)Creates a future from a value.