Struct Watcher

pub struct Watcher { /* private fields */ }

A watcher side of the graceful shutdown.

This type can only watch a connection, it cannot trigger a shutdown.

Call [GracefulShutdown::watcher()] to construct one of these.

Implementations

impl Watcher

fn watch<C: GracefulConnection>(self, conn: C) -> impl Future<Output = C::Output>

Wrap a future for graceful shutdown watching.

Trait Implementations

impl Debug for Watcher

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl !RefUnwindSafe for Watcher

impl !UnwindSafe for Watcher

impl Freeze for Watcher

impl Send for Watcher

impl Sync for Watcher

impl Unpin for Watcher

impl UnsafeUnpin for Watcher

Blanket Implementations

impl<T> Any for Watcher where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Watcher where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Watcher where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for Watcher

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for Watcher

impl<T> WithSubscriber for Watcher

impl<T, U> Into<U> for Watcher where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Watcher where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Watcher where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>