hyper_util::server::graceful

Trait GracefulConnection

Source
pub trait GracefulConnection: Future<Output = Result<(), Self::Error>> + Sealed {
    type Error;

    // Required method
    fn graceful_shutdown(self: Pin<&mut Self>);
}
Available on crate features server and server-graceful only.
Expand description

An internal utility trait as an umbrella target for all (hyper) connection types that the GracefulShutdown can watch.

Required Associated Types§

Source

type Error

The error type returned by the connection when used as a future.

Required Methods§

Source

fn graceful_shutdown(self: Pin<&mut Self>)

Start a graceful shutdown process for this connection.

Implementations on Foreign Types§

Source§

impl<I, B, S> GracefulConnection for Connection<I, S>
where S: HttpService<Incoming, ResBody = B>, S::Error: Into<Box<dyn Error + Send + Sync>>, I: Read + Write + Unpin + 'static, B: Body + 'static, B::Error: Into<Box<dyn Error + Send + Sync>>,

Available on crate feature http1 only.
Source§

impl<I, B, S, E> GracefulConnection for Connection<I, S, E>
where S: HttpService<Incoming, ResBody = B>, S::Error: Into<Box<dyn Error + Send + Sync>>, I: Read + Write + Unpin + 'static, B: Body + 'static, B::Error: Into<Box<dyn Error + Send + Sync>>, E: Http2ServerConnExec<S::Future, B>,

Available on crate feature http2 only.

Implementors§

Source§

impl<'a, I, B, S, E> GracefulConnection for hyper_util::server::conn::auto::Connection<'a, I, S, E>
where S: Service<Request<Incoming>, Response = Response<B>>, S::Error: Into<Box<dyn Error + Send + Sync>>, S::Future: 'static, I: Read + Write + Unpin + 'static, B: Body + 'static, B::Error: Into<Box<dyn Error + Send + Sync>>, E: Http2ServerConnExec<S::Future, B>,

Available on crate feature server-auto only.
Source§

type Error = Box<dyn Error + Sync + Send>

Source§

impl<'a, I, B, S, E> GracefulConnection for UpgradeableConnection<'a, I, S, E>
where S: Service<Request<Incoming>, Response = Response<B>>, S::Error: Into<Box<dyn Error + Send + Sync>>, S::Future: 'static, I: Read + Write + Unpin + Send + 'static, B: Body + 'static, B::Error: Into<Box<dyn Error + Send + Sync>>, E: Http2ServerConnExec<S::Future, B>,

Available on crate feature server-auto only.
Source§

type Error = Box<dyn Error + Sync + Send>