Skip to main content

CheckpointControl

Struct CheckpointControl 

Source
pub struct CheckpointControl<'a> {
    pub resume: Option<&'a Checkpoint>,
    pub every: Option<f64>,
    pub on_checkpoint: Option<&'a mut CheckpointSink<'a>>,
    pub final_snapshot: bool,
}
Expand description

How a run interacts with checkpoints — see simulate_transient_with_blocks_checkpointed.

Fields§

§resume: Option<&'a Checkpoint>

Continue from this snapshot instead of from x_initial/ic=/rest. t_final is still absolute simulated time; a checkpoint at or past it yields an empty run.

§every: Option<f64>

Hand a fresh snapshot to on_checkpoint every time this much simulated time has passed since the last one (the first interval counts from the run’s start). None: only the final snapshot is returned, none are handed out mid-run.

§on_checkpoint: Option<&'a mut CheckpointSink<'a>>

Receives each mid-run snapshot (see every). Typically writes it to a file.

§final_snapshot: bool

Return the run’s final state as a snapshot. Off by default so a run that never asked for a checkpoint (every pre-existing caller) is unaffected by an escape-hatch block whose state cannot be snapshotted – see DaeError::CheckpointUnsupportedBlock.

Trait Implementations§

Source§

impl<'a> Default for CheckpointControl<'a>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for CheckpointControl<'a>

§

impl<'a> !Send for CheckpointControl<'a>

§

impl<'a> !Sync for CheckpointControl<'a>

§

impl<'a> !UnwindSafe for CheckpointControl<'a>

§

impl<'a> Forget for CheckpointControl<'a>

§

impl<'a> Freeze for CheckpointControl<'a>

§

impl<'a> Move for CheckpointControl<'a>

§

impl<'a> Unpin for CheckpointControl<'a>

§

impl<'a> UnsafeUnpin for CheckpointControl<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.