ShutdownExt

Trait ShutdownExt 

Source
pub trait ShutdownExt: Future + Sized {
    // Provided method
    fn with_shutdown(
        self,
        shutdown: &GracefulShutdown,
    ) -> Pin<Box<dyn Future<Output = Option<Self::Output>> + Send + '_>>
       where Self: Send + 'static,
             Self::Output: Send { ... }
}
Expand description

Extension trait for futures that adds shutdown awareness

Provided Methods§

Source

fn with_shutdown( self, shutdown: &GracefulShutdown, ) -> Pin<Box<dyn Future<Output = Option<Self::Output>> + Send + '_>>
where Self: Send + 'static, Self::Output: Send,

Run this future until completion or shutdown

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§