[][src]Struct task_scope::cancelable::Cancelable

#[must_use = "do nothing unless polled"]
pub struct Cancelable<T> { /* fields omitted */ }

A cancelable wrapper for asynchronous operations.

This wrapper is created by cancelable function.

Methods

impl<T> Cancelable<T>[src]

pub fn poll_canceled(
    self: Pin<&mut Self>,
    cx: &mut Context
) -> Poll<Option<Canceled>>
[src]

Polls whether the task is canceled.

Returns

Returns Ready(Some(reason)) if the task is canceled. Returns Ready(None) if the context doesn't support cancellation.

pub fn inner(self: Pin<&mut Self>) -> Pin<&mut T>[src]

retrieve the inner value.

Trait Implementations

impl<T> AsyncRead for Cancelable<T> where
    T: AsyncRead
[src]

impl<T> AsyncRead for Cancelable<T> where
    T: AsyncRead
[src]

impl<T> AsyncWrite for Cancelable<T> where
    T: AsyncWrite
[src]

impl<T> AsyncWrite for Cancelable<T> where
    T: AsyncWrite
[src]

impl<T> FusedFuture for Cancelable<T> where
    T: FusedFuture
[src]

impl<T> FusedStream for Cancelable<T> where
    T: FusedStream
[src]

impl<T> Future for Cancelable<T> where
    T: Future
[src]

type Output = Result<T::Output, Canceled>

The type of value produced on completion.

impl<T> Stream for Cancelable<T> where
    T: Stream
[src]

type Item = Result<T::Item, Canceled>

Values yielded by the stream.

impl<'pin, T> Unpin for Cancelable<T> where
    __Cancelable<'pin, T>: Unpin
[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Cancelable<T>

impl<T> Send for Cancelable<T> where
    T: Send

impl<T> !Sync for Cancelable<T>

impl<T> !UnwindSafe for Cancelable<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized
[src]

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized
[src]

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?Sized
[src]

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FutureExt for T where
    T: Future + ?Sized
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

impl<St> StreamExt for St where
    St: Stream + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<F, T, E> TryFuture for F where
    F: Future<Output = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<Fut> TryFutureExt for Fut where
    Fut: TryFuture + ?Sized
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]