Struct graceful_shutdown::Handle [−][src]
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>ⓘ
[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
Auto Trait Implementations
impl RefUnwindSafe for Handle
[src]
impl Send for Handle
[src]
impl Sync for Handle
[src]
impl Unpin for Handle
[src]
impl UnwindSafe for Handle
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,