pub struct ProcessShutdown { /* private fields */ }Expand description
A shutdown signal for a process.
This struct can be used to wait for a shutdown signal from the supervisor to which the process belongs.
Implementations§
Source§impl ProcessShutdown
impl ProcessShutdown
Sourcepub fn paired() -> (Self, ShutdownHandle)
pub fn paired() -> (Self, ShutdownHandle)
Creates a new ProcessShutdown and ShutdownHandle pair.
When ShutdownHandle is triggered, or dropped, ProcessShutdown will resolve.
Sourcepub fn wrapped<F: Future + Send + 'static>(future: F) -> Self
pub fn wrapped<F: Future + Send + 'static>(future: F) -> Self
Creates a new ProcessShutdown from the given future.
ProcessShutdown will be resolve only once future resolves.
Sourcepub fn noop() -> Self
pub fn noop() -> Self
Creates a new ProcessShutdown that never resolves.
This is useful for cases where a ProcessShutdown is required, but no shutdown signal is expected.
Sourcepub async fn wait_for_shutdown(&mut self)
pub async fn wait_for_shutdown(&mut self)
Waits for the shutdown signal to be received.
If the shutdown signal has been received during a previous call to this function, this function will return immediately for all subsequent calls.
Auto Trait Implementations§
impl Freeze for ProcessShutdown
impl !RefUnwindSafe for ProcessShutdown
impl Send for ProcessShutdown
impl !Sync for ProcessShutdown
impl Unpin for ProcessShutdown
impl !UnwindSafe for ProcessShutdown
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Track for T
impl<T> Track for T
§fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
Instruments this type by attaching the given allocation group token, returning a
Tracked wrapper. Read more§fn in_current_allocation_group(self) -> Tracked<Self>
fn in_current_allocation_group(self) -> Tracked<Self>
Instruments this type by attaching the current allocation group, returning a
Tracked wrapper. Read more