pub struct SessionDeadline { /* private fields */ }Expand description
A session’s absolute deadline. Immutable after construction, so it is shared
as Arc<SessionDeadline> with no lock.
Implementations§
Source§impl SessionDeadline
impl SessionDeadline
Sourcepub fn new(max_wall_secs: Option<u64>) -> Self
pub fn new(max_wall_secs: Option<u64>) -> Self
Start the clock. None disables the ceiling entirely.
The default ceiling, as a shared handle ready to thread down the ladder.
Sourcepub fn admit(&self) -> Option<String>
pub fn admit(&self) -> Option<String>
Whether another iteration may begin. None admits; Some(reason)
denies, with text meant for a human and for LoopOutcome.error.
Sourcepub fn remaining_secs(&self) -> Option<u64>
pub fn remaining_secs(&self) -> Option<u64>
Seconds left before the deadline, or None when unbounded.
Callers clamp a round’s own timeout to this so admission cannot be followed by a full-length overrun. Saturates at 0 rather than wrapping.
Sourcepub fn remaining_duration(&self) -> Option<Duration>
pub fn remaining_duration(&self) -> Option<Duration>
Exact remaining duration. Agent builds use this to cancel an in-flight model/scenario future at the deadline instead of waiting for the next iteration-admission boundary.
pub fn elapsed_secs(&self) -> u64
Sourcepub fn elapsed_millis(&self) -> u64
pub fn elapsed_millis(&self) -> u64
Elapsed wall time in whole milliseconds, for check-result durations.
Sourcepub fn max_wall_secs(&self) -> Option<u64>
pub fn max_wall_secs(&self) -> Option<u64>
Configured whole-second ceiling, or None when unlimited.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionDeadline
impl RefUnwindSafe for SessionDeadline
impl Send for SessionDeadline
impl Sync for SessionDeadline
impl Unpin for SessionDeadline
impl UnsafeUnpin for SessionDeadline
impl UnwindSafe for SessionDeadline
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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> 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