pub struct WithGracefulShutdown<L, M, S, F, B, E = TokioExecutor> { /* private fields */ }Expand description
Serve future with graceful shutdown enabled.
Implementations§
Source§impl<L, M, S, F, B, E> WithGracefulShutdown<L, M, S, F, B, E>where
L: Listener,
impl<L, M, S, F, B, E> WithGracefulShutdown<L, M, S, F, B, E>where
L: Listener,
Sourcepub fn local_addr(&self) -> Result<<L as Listener>::Addr, Error>
pub fn local_addr(&self) -> Result<<L as Listener>::Addr, Error>
Returns the local address this server is bound to.
Sourcepub fn with_executor<E2>(
self,
executor: E2,
) -> WithGracefulShutdown<L, M, S, F, B, E2>where
E2: Executor,
pub fn with_executor<E2>(
self,
executor: E2,
) -> WithGracefulShutdown<L, M, S, F, B, E2>where
E2: Executor,
Provide a custom Executor to use for spawning connection tasks and
hyper’s internal tasks (e.g. HTTP/2).
See Serve::with_executor for details.
Sourcepub fn connection_lifetime_limits(
self,
limits: ConnectionLifetimeLimits,
) -> WithGracefulShutdown<L, M, S, F, B, E>
pub fn connection_lifetime_limits( self, limits: ConnectionLifetimeLimits, ) -> WithGracefulShutdown<L, M, S, F, B, E>
Apply per-connection ConnectionLifetimeLimits, bounding the lifetime of
individual connections.
See Serve::connection_lifetime_limits and ConnectionLifetimeLimits for details.
Trait Implementations§
Source§impl<L, M, S, F, B, E> Debug for WithGracefulShutdown<L, M, S, F, B, E>
impl<L, M, S, F, B, E> Debug for WithGracefulShutdown<L, M, S, F, B, E>
Source§impl<L, M, S, F, B, E> IntoFuture for WithGracefulShutdown<L, M, S, F, B, E>where
L: Listener,
<L as Listener>::Addr: Debug,
M: for<'a> Service<IncomingStream<'a, L>, Error = !, Response = S> + Send + 'static,
<M as Service<IncomingStream<'a, L>>>::Future: for<'a> Send,
S: Service<Request<Body>, Response = Response<B>, Error = !> + Clone + Send + 'static,
<S as Service<Request<Body>>>::Future: Send,
F: Future<Output = ()> + Send + 'static,
B: Body + Send + 'static,
<B as Body>::Data: Send,
<B as Body>::Error: Into<Box<dyn Error + Send + Sync>>,
E: Executor,
impl<L, M, S, F, B, E> IntoFuture for WithGracefulShutdown<L, M, S, F, B, E>where
L: Listener,
<L as Listener>::Addr: Debug,
M: for<'a> Service<IncomingStream<'a, L>, Error = !, Response = S> + Send + 'static,
<M as Service<IncomingStream<'a, L>>>::Future: for<'a> Send,
S: Service<Request<Body>, Response = Response<B>, Error = !> + Clone + Send + 'static,
<S as Service<Request<Body>>>::Future: Send,
F: Future<Output = ()> + Send + 'static,
B: Body + Send + 'static,
<B as Body>::Data: Send,
<B as Body>::Error: Into<Box<dyn Error + Send + Sync>>,
E: Executor,
Source§type IntoFuture = ServeFuture<()>
type IntoFuture = ServeFuture<()>
Which kind of future are we turning this into?
Source§fn into_future(
self,
) -> <WithGracefulShutdown<L, M, S, F, B, E> as IntoFuture>::IntoFuture
fn into_future( self, ) -> <WithGracefulShutdown<L, M, S, F, B, E> as IntoFuture>::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<L, M, S, F, B, E> Freeze for WithGracefulShutdown<L, M, S, F, B, E>
impl<L, M, S, F, B, E> RefUnwindSafe for WithGracefulShutdown<L, M, S, F, B, E>
impl<L, M, S, F, B, E> Send for WithGracefulShutdown<L, M, S, F, B, E>
impl<L, M, S, F, B, E> Sync for WithGracefulShutdown<L, M, S, F, B, E>
impl<L, M, S, F, B, E> Unpin for WithGracefulShutdown<L, M, S, F, B, E>
impl<L, M, S, F, B, E> UnsafeUnpin for WithGracefulShutdown<L, M, S, F, B, E>
impl<L, M, S, F, B, E> UnwindSafe for WithGracefulShutdown<L, M, S, F, B, E>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more