Struct ReplacementSpec
pub struct ReplacementSpec {
pub template: TrialTemplate,
pub attempt: u32,
pub retry_of: Option<TrialId>,
pub max_trials: Option<u64>,
pub restart: Option<ReplacementRestart>,
}Expand description
Typed retry/fork metadata attached to a replacement creation effect.
The template carries fixed parameters and fork parentage. The storage contract owns retry-source metadata, so adapters do not depend on a private Study retry record. A fork normally has a parent in its template and no retry source, with attempt set to zero; a retry has a retry source and a positive attempt.
Fields§
§template: TrialTemplateFixed parameters and optional fork parent for the child trial.
attempt: u32The retry attempt number, or zero for a non-retry fork.
retry_of: Option<TrialId>The failed source trial when this replacement is a retry.
max_trials: Option<u64>The durable created-record limit to apply to this replacement.
restart: Option<ReplacementRestart>The restart this replacement starts, or None for a plain fork or a
retry. Absent from the serialized effect when None, so fork and retry
effects keep their bytes.
Implementations§
§impl ReplacementSpec
impl ReplacementSpec
pub const fn new(
template: TrialTemplate,
attempt: u32,
retry_of: Option<TrialId>,
) -> Self
pub const fn new( template: TrialTemplate, attempt: u32, retry_of: Option<TrialId>, ) -> Self
Creates replacement metadata with no additional budget limit.
pub const fn with_restart(self, donor: TrialId, mode: RestartMode) -> Self
pub const fn with_restart(self, donor: TrialId, mode: RestartMode) -> Self
Marks this replacement as a restart of donor in mode.
pub const fn with_max_trials(self, max_trials: Option<u64>) -> Self
pub const fn with_max_trials(self, max_trials: Option<u64>) -> Self
Sets the durable created-record limit used by replacement creation.
Trait Implementations§
§impl Clone for ReplacementSpec
impl Clone for ReplacementSpec
§fn clone(&self) -> ReplacementSpec
fn clone(&self) -> ReplacementSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more