Skip to main content

WithGracefulShutdown

Struct WithGracefulShutdown 

Source
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,

Source

pub fn local_addr(&self) -> Result<<L as Listener>::Addr, Error>

Returns the local address this server is bound to.

Source

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.

Source

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>
where L: Debug + 'static, M: Debug, S: Debug, F: Debug, E: Debug,

Source§

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

Formats the value using the given formatter. Read more
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,

Source§

type Output = ()

The output that the future will produce on completion.
Source§

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

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>
where L: Freeze, M: Freeze, E: Freeze, F: Freeze,

§

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>
where L: Send, M: Send, E: Send, F: Send,

§

impl<L, M, S, F, B, E> Sync for WithGracefulShutdown<L, M, S, F, B, E>
where L: Sync, M: Sync, E: Sync, F: Sync,

§

impl<L, M, S, F, B, E> Unpin for WithGracefulShutdown<L, M, S, F, B, E>
where L: Unpin, M: Unpin, E: Unpin, F: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more