pub struct HostShutdownHandle { /* private fields */ }Expand description
A handle that waits for a host to finish shutting down.
Obtained from host. Awaiting HostShutdownHandle::stop_and_join
blocks until the [ShutdownHost] handler sends back the client transport
handles, stops and joins them, and (if exit_on_shutdown) calls
process::exit.
Note: [DrainHost] does not trigger this handle — a drained host
keeps its mailbox server (and Unix socket) alive so new clients can
reconnect to the same address.
Implementations§
Source§impl HostShutdownHandle
impl HostShutdownHandle
Sourcepub async fn wait_for_drain(self) -> DrainedHostShutdown
pub async fn wait_for_drain(self) -> DrainedHostShutdown
Wait for the host to drain its children and release its client transports.
The returned transports remain live until
DrainedHostShutdown::stop_and_join, so callers can perform final
client-side flushes before teardown.
Sourcepub async fn stop_and_join_after_drain(
self,
before_join: impl Future<Output = ()>,
)
pub async fn stop_and_join_after_drain( self, before_join: impl Future<Output = ()>, )
Wait for the host to drain, run before_join while its transports are
still serving, and then stop and join the transport servers.
Sourcepub async fn stop_and_join(self)
pub async fn stop_and_join(self)
Wait for the host to finish shutting down, stop and join its transport servers, and optionally exit the process.
Auto Trait Implementations§
impl !RefUnwindSafe for HostShutdownHandle
impl !UnwindSafe for HostShutdownHandle
impl Freeze for HostShutdownHandle
impl Send for HostShutdownHandle
impl Sync for HostShutdownHandle
impl Unpin for HostShutdownHandle
impl UnsafeUnpin for HostShutdownHandle
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].