Struct Abortable
struct Abortable<T> { ... }
A future/stream which can be remotely short-circuited using an AbortHandle.
Implementations
impl<T> Abortable<T>
fn new(task: T, reg: AbortRegistration) -> SelfCreates a new
Abortablefuture/stream using an existingAbortRegistration.AbortRegistrations can be acquired throughAbortHandle::new.When
abortis called on the handle tied toregor ifaborthas already been called, the future/stream will complete immediately without making any further progress.Examples:
Usage with futures:
# block_on;Usage with streams:
# block_on;fn is_aborted(self: &Self) -> boolChecks whether the task has been aborted. Note that all this method indicates is whether
AbortHandle::abortwas called. This means that it will returntrueeven if:abortwas called after the task had completed.abortwas called while the task was being polled - the task may still be running and will not be stopped untilpollreturns.
impl<'__pin, T> Unpin for Abortable<T>
impl<F> IntoFuture for Abortable<T>
fn into_future(self: Self) -> <F as IntoFuture>::IntoFuture
impl<F, T, E> TryFuture for Abortable<T>
fn try_poll(self: Pin<&mut F>, cx: &mut Context<'_>) -> Poll<<F as Future>::Output>
impl<Fut> Future for Abortable<Fut>
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<<Self as >::Output>
impl<Fut> TryFutureExt for Abortable<T>
impl<S> TryStreamExt for Abortable<T>
impl<S, T, E> TryStream for Abortable<T>
fn try_poll_next(self: Pin<&mut S>, cx: &mut Context<'_>) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>
impl<St> Stream for Abortable<St>
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<<Self as >::Item>>
impl<T> Any for Abortable<T>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Abortable<T>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Abortable<T>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Abortable<T>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> Freeze for Abortable<T>
impl<T> From for Abortable<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> FutureExt for Abortable<T>
impl<T> RefUnwindSafe for Abortable<T>
impl<T> Send for Abortable<T>
impl<T> StreamExt for Abortable<T>
impl<T> Sync for Abortable<T>
impl<T> ToOwned for Abortable<T>
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> UnsafeUnpin for Abortable<T>
impl<T> UnwindSafe for Abortable<T>
impl<T, U> Into for Abortable<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 Abortable<T>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Abortable<T>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T: $crate::clone::Clone> Clone for Abortable<T>
fn clone(self: &Self) -> Abortable<T>
impl<T: $crate::fmt::Debug> Debug for Abortable<T>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result