[][src]Struct task_scope::scope::ScopeFuture

#[must_use = "futures do nothing unless polled"]
pub struct ScopeFuture<Fut, Joiner> where
    Fut: Future
{ /* fields omitted */ }

A future that manages a scope.

This future is created by scope function.

Methods

impl<Fut, Joiner> ScopeFuture<Fut, Joiner> where
    Fut: Future
[src]

pub fn cancel(self: Pin<&mut Self>)[src]

Initiates a graceful cancellation.

This function will send a wakeup signal to all the cancellation futures in the scope. Tasks in the scope can continue execution, but they are expected to stop the subsequent processing during the grace period.

The cancellation signal will be automatically delivered to all scopes inside self.

pub fn force_cancel(self: Pin<&mut Self>)[src]

Cancels all the tasks in the scope forcibly. Tasks within the scope enter a mercy period. They can do the last cleanup before exitting but will be automatically stopped at the next yield.

Tasks should shorten the mercy period as short as possible by introducing a cancellation point regularly, because it's a kind of violation of Structured Concurrency (children are outliving the dropped parent).

Trait Implementations

impl<Fut, Joiner> FusedFuture for ScopeFuture<Fut, Joiner> where
    Fut: Future,
    Joiner: Future<Output = ()>, 
[src]

impl<Fut, Joiner> Future for ScopeFuture<Fut, Joiner> where
    Fut: Future,
    Joiner: Future<Output = ()>, 
[src]

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

The type of value produced on completion.

impl<'pin, Fut, Joiner> Unpin for ScopeFuture<Fut, Joiner> where
    Fut: Future,
    __ScopeFuture<'pin, Fut, Joiner>: Unpin
[src]

Auto Trait Implementations

impl<Fut, Joiner> !RefUnwindSafe for ScopeFuture<Fut, Joiner>

impl<Fut, Joiner> Send for ScopeFuture<Fut, Joiner> where
    Fut: Send,
    Joiner: Send,
    <Fut as Future>::Output: Send

impl<Fut, Joiner> !Sync for ScopeFuture<Fut, Joiner>

impl<Fut, Joiner> !UnwindSafe for ScopeFuture<Fut, Joiner>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?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, 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.