pub struct RequestReadContext { /* private fields */ }Expand description
Opaque snapshot of the current request read context.
Backend implementations capture this once before crossing into blocking work so nested scopes and spawned children share one absolute deadline.
Implementations§
Source§impl RequestReadContext
impl RequestReadContext
Sourcepub fn scope_store_acquisition<T>(
self,
operation: &'static str,
work: impl FnOnce() -> T,
) -> T
pub fn scope_store_acquisition<T>( self, operation: &'static str, work: impl FnOnce() -> T, ) -> T
Opt one blocking store-constructor call into request-aware admission. Ordinary accessors under a read context remain outside this scope. The previous context is restored even if the constructor panics.
Sourcepub fn store_acquisition_operation(&self) -> Option<&'static str>
pub fn store_acquisition_operation(&self) -> Option<&'static str>
The explicitly scoped constructor operation, absent for ordinary callers.
Sourcepub fn blocking_stop_reason(&self) -> Option<RequestReadStopReason>
pub fn blocking_stop_reason(&self) -> Option<RequestReadStopReason>
Observe cancellation and the original wall-clock deadline in blocking work.
Sourcepub fn deadline(&self) -> Option<RequestReadDeadline>
pub fn deadline(&self) -> Option<RequestReadDeadline>
Return the request’s absolute deadline, when one is installed.
Sourcepub fn stop_reason(&self) -> Option<RequestReadStopReason>
pub fn stop_reason(&self) -> Option<RequestReadStopReason>
Return the currently observed stop cause without waiting.
Sourcepub async fn wait_for_stop(self) -> RequestReadStopReason
pub async fn wait_for_stop(self) -> RequestReadStopReason
Wait until one merged cancellation source fires or the deadline elapses.
Trait Implementations§
Source§impl Clone for RequestReadContext
impl Clone for RequestReadContext
Auto Trait Implementations§
impl !RefUnwindSafe for RequestReadContext
impl !UnwindSafe for RequestReadContext
impl Freeze for RequestReadContext
impl Send for RequestReadContext
impl Sync for RequestReadContext
impl Unpin for RequestReadContext
impl UnsafeUnpin for RequestReadContext
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