pub struct SessionDeadline { /* private fields */ }Expand description
The hard limit a session runs under: its own mur run --deadline, or the moment it inherited
from the formation or capsule that launched it.
Both clocks are read once, at the session’s start. The monotonic one is what the runtime
enforces and counts down against; the wall one is only what at is spelled from, so a clock
change during the session moves neither the enforcement nor left_secs.
Implementations§
Source§impl SessionDeadline
impl SessionDeadline
Sourcepub fn after(started: Instant, started_wall: SystemTime, secs: u64) -> Self
pub fn after(started: Instant, started_wall: SystemTime, secs: u64) -> Self
The deadline secs after a start read as started and started_wall. A secs above
MAX_DEADLINE_SECS is taken as that bound.
Sourcepub fn until(
started: Instant,
started_wall: SystemTime,
at_wall: SystemTime,
) -> Self
pub fn until( started: Instant, started_wall: SystemTime, at_wall: SystemTime, ) -> Self
The inherited deadline at the wall moment at_wall, for a session whose start was read as
started and started_wall. What is left is at_wall - started_wall: zero when the moment
has passed, and at most MAX_DEADLINE_SECS, beyond which at is that bound.
Sourcepub fn from_unix_millis(
started: Instant,
started_wall: SystemTime,
millis: u64,
) -> Self
pub fn from_unix_millis( started: Instant, started_wall: SystemTime, millis: u64, ) -> Self
SessionDeadline::until the moment millis milliseconds after the Unix epoch, as
INHERITED_DEADLINE_FLAG carries it. A moment the wall clock cannot hold is taken as the
bound.
Sourcepub fn at_unix_millis(&self) -> u64
pub fn at_unix_millis(&self) -> u64
at in whole milliseconds since the Unix epoch, the value INHERITED_DEADLINE_FLAG
carries. Truncated, so the moment a session inherits is never later than this one and
spells the same second.
Sourcepub fn earliest(own: Option<Self>, inherited: Option<Self>) -> Option<Self>
pub fn earliest(own: Option<Self>, inherited: Option<Self>) -> Option<Self>
The session’s deadline: the earlier of its own and the inherited one, the inherited one on a
tie, and None when it has neither. Both must have been read against the same start.
Sourcepub fn secs(&self) -> u64
pub fn secs(&self) -> u64
Seconds from the session’s start to at: the --deadline value for an own deadline, and
rounded up, 0 once passed, for an inherited one.
Sourcepub fn source(&self) -> DeadlineSource
pub fn source(&self) -> DeadlineSource
Where the deadline came from.
Sourcepub fn at_rfc3339(&self) -> String
pub fn at_rfc3339(&self) -> String
When the runtime ends the session, as RFC 3339 UTC to the second.
Trait Implementations§
Source§impl Clone for SessionDeadline
impl Clone for SessionDeadline
impl Copy for SessionDeadline
Source§impl Debug for SessionDeadline
impl Debug for SessionDeadline
impl Eq for SessionDeadline
Source§impl PartialEq for SessionDeadline
impl PartialEq for SessionDeadline
impl StructuralPartialEq for SessionDeadline
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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