Struct RemoteHandle
struct RemoteHandle<T> { ... }
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
impl<T> RemoteHandle<T>
fn forget(self: Self)Drops this handle without canceling the underlying future.
This method can be used if you want to drop the handle, but let the execution continue.
impl<F> IntoFuture for RemoteHandle<T>
fn into_future(self: Self) -> <F as IntoFuture>::IntoFuture
impl<F, T, E> TryFuture for RemoteHandle<T>
fn try_poll(self: Pin<&mut F>, cx: &mut Context<'_>) -> Poll<<F as Future>::Output>
impl<Fut> TryFutureExt for RemoteHandle<T>
impl<T> Any for RemoteHandle<T>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for RemoteHandle<T>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for RemoteHandle<T>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> Freeze for RemoteHandle<T>
impl<T> From for RemoteHandle<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> FutureExt for RemoteHandle<T>
impl<T> RefUnwindSafe for RemoteHandle<T>
impl<T> Send for RemoteHandle<T>
impl<T> Sync for RemoteHandle<T>
impl<T> Unpin for RemoteHandle<T>
impl<T> UnsafeUnpin for RemoteHandle<T>
impl<T> UnwindSafe for RemoteHandle<T>
impl<T, U> Into for RemoteHandle<T>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for RemoteHandle<T>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for RemoteHandle<T>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T: $crate::fmt::Debug> Debug for RemoteHandle<T>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<T: 'static> Future for RemoteHandle<T>
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<T>