Struct ReplacementSpec
pub struct ReplacementSpec {
pub template: TrialTemplate,
pub attempt: u32,
pub retry_of: Option<TrialId>,
pub max_trials: Option<u64>,
}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.
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_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
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 ReplacementSpec
impl Debug for ReplacementSpec
§impl<'de> Deserialize<'de> for ReplacementSpec
impl<'de> Deserialize<'de> for ReplacementSpec
§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 PartialEq for ReplacementSpec
impl PartialEq for ReplacementSpec
§impl Serialize for ReplacementSpec
impl Serialize for ReplacementSpec
impl StructuralPartialEq for ReplacementSpec
Auto Trait Implementations§
impl Freeze for ReplacementSpec
impl RefUnwindSafe for ReplacementSpec
impl Send for ReplacementSpec
impl Sync for ReplacementSpec
impl Unpin for ReplacementSpec
impl UnsafeUnpin for ReplacementSpec
impl UnwindSafe for ReplacementSpec
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