pub struct TimeoutManager { /* private fields */ }Expand description
Timeout manager for cascading deadlines with validation
Implementations§
Source§impl TimeoutManager
impl TimeoutManager
Sourcepub fn with_deadline(
global_deadline: Instant,
operation_timeout: Duration,
) -> Self
pub fn with_deadline( global_deadline: Instant, operation_timeout: Duration, ) -> Self
Create with global deadline
Sourcepub fn ValidateTimeoutResult(timeout: Duration) -> Result<Duration, String>
pub fn ValidateTimeoutResult(timeout: Duration) -> Result<Duration, String>
Validate timeout as Result for error handling
Sourcepub fn effective_timeout(&self) -> Duration
pub fn effective_timeout(&self) -> Duration
Get effective timeout (minimum of operation timeout and remaining time)
Sourcepub fn EffectiveTimeout(&self) -> Duration
pub fn EffectiveTimeout(&self) -> Duration
Get effective timeout with validation
Sourcepub fn is_exceeded(&self) -> bool
pub fn is_exceeded(&self) -> bool
Check if deadline has been exceeded
Sourcepub fn IsExceeded(&self) -> bool
pub fn IsExceeded(&self) -> bool
Check if deadline has been exceeded with panic recovery
Sourcepub fn GetGlobalDeadline(&self) -> Option<Instant>
pub fn GetGlobalDeadline(&self) -> Option<Instant>
Get the global deadline
Sourcepub fn GetOperationTimeout(&self) -> Duration
pub fn GetOperationTimeout(&self) -> Duration
Get the operation timeout
Trait Implementations§
Source§impl Clone for TimeoutManager
impl Clone for TimeoutManager
Source§fn clone(&self) -> TimeoutManager
fn clone(&self) -> TimeoutManager
Returns a duplicate of the value. Read more
1.0.0 · 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 TimeoutManager
impl RefUnwindSafe for TimeoutManager
impl Send for TimeoutManager
impl Sync for TimeoutManager
impl Unpin for TimeoutManager
impl UnwindSafe for TimeoutManager
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
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>,
Applies the layer to a service and wraps it in [
Layered].