Struct graceful_shutdown::Handle[][src]

pub struct Handle(_);

A shared reference to a Shutdown.

This allows communicating with a Shutdown object without needing ownership to the

Implementations

impl Handle[src]

pub fn shutdown(&self)[src]

Initiate shutdown.

This signals that a graceful shutdown shold be started. After calling this is_shutting_down will return true for any reference to the same Shutdown instance. And once all pending tasks are completed, the Shutdown future will complete.

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

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

pub fn graceful<F: Future>(&self, task: F) -> Graceful<F>

Notable traits for Graceful<F>

impl<F: Future> Future for Graceful<F> type Output = F::Output;
[src]

Wrap a future so that it prevents the Shutdown future from completing until after this future completes.

pub fn draining(&self) -> Draining[src]

Return an object that prevents the Shutdown future from completing while it is live.

Trait Implementations

impl Clone for Handle[src]

Auto Trait Implementations

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, U> Into<U> for T where
    U: From<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.