pub struct SimulationTime { /* private fields */ }Expand description
The temporal coordinate associated with one SystemState.
iteration is always present and provides deterministic ordering, chunk
boundaries, and checkpoint identity. physical_time optionally records a
finite domain time such as seconds or model time. Time-axis units belong to
stream metadata so they are not repeated in every state.
Implementations§
Source§impl SimulationTime
impl SimulationTime
Sourcepub const fn from_iteration(iteration: u64) -> Self
pub const fn from_iteration(iteration: u64) -> Self
Creates an iteration-only time point.
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 time point with a finite physical coordinate.
Returns None for NaN or either infinity. Negative finite values are
accepted because some scientific coordinate systems use an origin after
the beginning of a simulation or observation.
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 scientific time without mutating a state.
None advances only the iteration and preserves the optional physical
coordinate. Some(delta) also advances an existing physical coordinate.
All overflow and finiteness checks are identical to
SystemState::advance_simulation_time.
Trait Implementations§
Source§impl Clone for SimulationTime
impl Clone for SimulationTime
Source§fn clone(&self) -> SimulationTime
fn clone(&self) -> SimulationTime
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SimulationTime
Source§impl Debug for SimulationTime
impl Debug for SimulationTime
Source§impl PartialEq for SimulationTime
impl PartialEq for SimulationTime
impl StructuralPartialEq for SimulationTime
Auto Trait Implementations§
impl Freeze for SimulationTime
impl RefUnwindSafe for SimulationTime
impl Send for SimulationTime
impl Sync for SimulationTime
impl Unpin for SimulationTime
impl UnsafeUnpin for SimulationTime
impl UnwindSafe for SimulationTime
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<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