pub struct RequestLifecycle { /* private fields */ }Expand description
Coordinates request admission with graceful application shutdown.
Service adapters must acquire a RequestGuard before dispatching an
accepted request. Once shutdown begins, new acquisitions fail while guards
already issued remain valid until the corresponding request completes.
Implementations§
Source§impl RequestLifecycle
impl RequestLifecycle
Sourcepub fn phase(&self) -> ApplicationPhase
pub fn phase(&self) -> ApplicationPhase
Returns the application’s current lifecycle phase.
Sourcepub fn try_accept(&self) -> Result<RequestGuard>
pub fn try_accept(&self) -> Result<RequestGuard>
Admits one request if the application is ready and accepting work.
The returned guard must be held for the complete request execution. Its
Drop implementation records completion even when the request future is
cancelled or unwinds.
Trait Implementations§
Source§impl Clone for RequestLifecycle
impl Clone for RequestLifecycle
Source§fn clone(&self) -> RequestLifecycle
fn clone(&self) -> RequestLifecycle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RequestLifecycle
impl RefUnwindSafe for RequestLifecycle
impl Send for RequestLifecycle
impl Sync for RequestLifecycle
impl Unpin for RequestLifecycle
impl UnsafeUnpin for RequestLifecycle
impl UnwindSafe for RequestLifecycle
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