[][src]Enum kyansel::CancellableResult

pub enum CancellableResult<T, S> {
    Finished(T),
    Cancelled(S),
}

Result returned by Cancellable

Variants

Finished(T)

If the inner future finished

Cancelled(S)

If the inner future was cancelled

Methods

impl<T, S> CancellableResult<T, S>[src]

pub fn is_cancelled(&self) -> bool[src]

Check if the future was cancelled

pub fn finished(self) -> Option<T>[src]

Retrieve the result of the future if it was not cancelled

pub fn cancelled(self) -> Option<S>[src]

Retrieve the result of the canceller future if the future was cancelled

Trait Implementations

impl<T: Clone, S: Clone> Clone for CancellableResult<T, S>[src]

impl<T: Copy, S: Copy> Copy for CancellableResult<T, S>[src]

impl<T: Eq, S: Eq> Eq for CancellableResult<T, S>[src]

impl<T: PartialEq, S: PartialEq> PartialEq<CancellableResult<T, S>> for CancellableResult<T, S>[src]

impl<T: Debug, S: Debug> Debug for CancellableResult<T, S>[src]

impl<T, S> StructuralPartialEq for CancellableResult<T, S>[src]

impl<T, S> StructuralEq for CancellableResult<T, S>[src]

Auto Trait Implementations

impl<T, S> Send for CancellableResult<T, S> where
    S: Send,
    T: Send

impl<T, S> Sync for CancellableResult<T, S> where
    S: Sync,
    T: Sync

impl<T, S> Unpin for CancellableResult<T, S> where
    S: Unpin,
    T: Unpin

impl<T, S> UnwindSafe for CancellableResult<T, S> where
    S: UnwindSafe,
    T: UnwindSafe

impl<T, S> RefUnwindSafe for CancellableResult<T, S> where
    S: RefUnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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