Struct TrialCheckpoints
#[non_exhaustive]pub struct TrialCheckpoints {
pub refs: BTreeMap<u64, String>,
pub replicates: BTreeMap<u32, BTreeMap<u64, String>>,
}Expand description
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.refs: BTreeMap<u64, String>step -> reference, ordered by step.
replicates: BTreeMap<u32, BTreeMap<u64, String>>replicate -> step -> reference for references recorded inside a
multi-seed fan, ordered by replicate index and then by step. Empty for
a trial that never ran as a fan.
Implementations§
§impl TrialCheckpoints
impl TrialCheckpoints
pub fn latest(&self) -> Option<(u64, &str)>
pub fn latest(&self) -> Option<(u64, &str)>
The most advanced checkpoint recorded, as (step, reference).
None when nothing has been recorded. This is the reference a
Fork child or a resumed trial
starts from.
pub fn record(&mut self, step: u64, reference: impl Into<String>)
pub fn record(&mut self, step: u64, reference: impl Into<String>)
Records reference at step, replacing any reference already at that
step.
pub fn latest_for(&self, replicate: u32) -> Option<(u64, &str)>
pub fn latest_for(&self, replicate: u32) -> Option<(u64, &str)>
The most advanced checkpoint replicate recorded, as
(step, reference).
None when that replicate recorded nothing; the trial-level
latest is then the fallback a resume uses.
pub fn record_replicate(
&mut self,
replicate: u32,
step: u64,
reference: impl Into<String>,
)
pub fn record_replicate( &mut self, replicate: u32, step: u64, reference: impl Into<String>, )
Records reference at step for one fan replicate, and at step on
the trial level, replacing any reference already at either.
Trait Implementations§
§impl Clone for TrialCheckpoints
impl Clone for TrialCheckpoints
§fn clone(&self) -> TrialCheckpoints
fn clone(&self) -> TrialCheckpoints
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for TrialCheckpoints
impl Debug for TrialCheckpoints
§impl Default for TrialCheckpoints
impl Default for TrialCheckpoints
§fn default() -> TrialCheckpoints
fn default() -> TrialCheckpoints
Returns the “default value” for a type. Read more
§impl<'de> Deserialize<'de> for TrialCheckpoints
impl<'de> Deserialize<'de> for TrialCheckpoints
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TrialCheckpoints
§impl PartialEq for TrialCheckpoints
impl PartialEq for TrialCheckpoints
§impl Serialize for TrialCheckpoints
impl Serialize for TrialCheckpoints
impl StructuralPartialEq for TrialCheckpoints
Auto Trait Implementations§
impl Freeze for TrialCheckpoints
impl RefUnwindSafe for TrialCheckpoints
impl Send for TrialCheckpoints
impl Sync for TrialCheckpoints
impl Unpin for TrialCheckpoints
impl UnsafeUnpin for TrialCheckpoints
impl UnwindSafe for TrialCheckpoints
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