pub struct StateTime { /* private fields */ }Expand description
The scientific time coordinate associated with one system state.
Every state has a deterministic iteration. A state may additionally carry
finite physical_time, such as seconds or dimensionless model time. This is
distinct from operational wall-clock timestamps recorded by Workflow.
Implementations§
Source§impl StateTime
impl StateTime
Sourcepub const fn from_iteration(iteration: u64) -> Self
pub const fn from_iteration(iteration: u64) -> Self
Creates an iteration-only state time.
Sourcepub fn from_iteration_and_physical_time(
iteration: u64,
physical_time: f64,
) -> Option<Self>
pub fn from_iteration_and_physical_time( iteration: u64, physical_time: f64, ) -> Option<Self>
Creates a state time with a finite physical coordinate.
Returns None for NaN or either infinity. Negative finite values are
accepted because scientific coordinates may precede an arbitrary origin.
Sourcepub const fn physical_time(self) -> Option<f64>
pub const fn physical_time(self) -> Option<f64>
Returns the optional physical coordinate.
Sourcepub fn checked_advance(
self,
physical_time_increment: Option<f64>,
) -> Result<Self, StateError>
pub fn checked_advance( self, physical_time_increment: Option<f64>, ) -> Result<Self, StateError>
Computes the next state time without mutating a state.
None advances only the iteration and preserves the optional physical
coordinate. Some(delta) also advances an existing physical coordinate.
Trait Implementations§
impl Copy for StateTime
impl StructuralPartialEq for StateTime
Auto Trait Implementations§
impl Freeze for StateTime
impl RefUnwindSafe for StateTime
impl Send for StateTime
impl Sync for StateTime
impl Unpin for StateTime
impl UnsafeUnpin for StateTime
impl UnwindSafe for StateTime
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,
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> ⓘ
Converts
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> ⓘ
Converts
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