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
sourceimpl<T> RemoteHandle<T>
impl<T> RemoteHandle<T>
Trait Implementations
sourceimpl<T: Debug> Debug for RemoteHandle<T>
impl<T: Debug> Debug for RemoteHandle<T>
sourceimpl<T: 'static> Future for RemoteHandle<T>
impl<T: 'static> Future for RemoteHandle<T>
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
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