Struct TrialTemplate
#[non_exhaustive]pub struct TrialTemplate {
pub fixed: Assignment,
pub parent: Option<TrialId>,
}Expand description
A request to create a trial with something already decided.
Covers two cases:
- enqueued trials: fixed parameters the user wants evaluated, which take priority over sampling (what a trial’s parameters actually are);
- forks: a child of
parent, used by PBT-style schedulers. Storage persists the reference ontoFrozenTrial::parentand does nothing else with it.
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.fixed: AssignmentParameters that must not be sampled.
parent: Option<TrialId>The trial this one forks from, if any.
Implementations§
§impl TrialTemplate
impl TrialTemplate
pub fn new_with_fixed_params(params: Assignment) -> Self
pub fn new_with_fixed_params(params: Assignment) -> Self
A template with fixed parameters and no parent.
pub fn new_with_parent_and_mutation(
parent: TrialId,
mutation: Assignment,
) -> Self
pub fn new_with_parent_and_mutation( parent: TrialId, mutation: Assignment, ) -> Self
A template that forks parent, carrying mutated parameters.
Trait Implementations§
§impl Clone for TrialTemplate
impl Clone for TrialTemplate
§fn clone(&self) -> TrialTemplate
fn clone(&self) -> TrialTemplate
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 TrialTemplate
impl Debug for TrialTemplate
§impl Default for TrialTemplate
impl Default for TrialTemplate
§fn default() -> TrialTemplate
fn default() -> TrialTemplate
Returns the “default value” for a type. Read more
§impl<'de> Deserialize<'de> for TrialTemplate
impl<'de> Deserialize<'de> for TrialTemplate
§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 TrialTemplate
impl PartialEq for TrialTemplate
§impl Serialize for TrialTemplate
impl Serialize for TrialTemplate
impl StructuralPartialEq for TrialTemplate
Auto Trait Implementations§
impl Freeze for TrialTemplate
impl RefUnwindSafe for TrialTemplate
impl Send for TrialTemplate
impl Sync for TrialTemplate
impl Unpin for TrialTemplate
impl UnsafeUnpin for TrialTemplate
impl UnwindSafe for TrialTemplate
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