pub struct SearchSpec {
pub along: String,
pub range: [f64; 2],
pub metric: String,
pub target: f64,
pub tolerance: f64,
pub log: bool,
pub max_evaluations: usize,
}Expand description
The search section of a specification.
Fields§
§along: StringThe variable searched.
range: [f64; 2]The bracket [lo, hi] of the search.
metric: StringThe metric.
target: f64The value of the metric to reach.
tolerance: f64Stop when the bracket is narrower (in the unit of the variable).
log: boolInterpolate log10 of the metric (rates spanning decades).
max_evaluations: usizeLargest number of evaluations per combination of the other axes.
Implementations§
Source§impl SearchSpec
impl SearchSpec
Sourcepub fn from_json(v: &Json) -> Result<SearchSpec>
pub fn from_json(v: &Json) -> Result<SearchSpec>
Parse and validate the search mapping.
§Errors
Error::Config for a missing field, an empty range or a non-positive tolerance.
Trait Implementations§
Source§impl Clone for SearchSpec
impl Clone for SearchSpec
Source§impl Debug for SearchSpec
impl Debug for SearchSpec
Source§impl<'de> Deserialize<'de> for SearchSpec
impl<'de> Deserialize<'de> for SearchSpec
Source§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
Auto Trait Implementations§
impl Forget for SearchSpec
impl Freeze for SearchSpec
impl RefUnwindSafe for SearchSpec
impl Send for SearchSpec
impl Sync for SearchSpec
impl Unpin for SearchSpec
impl UnsafeUnpin for SearchSpec
impl UnwindSafe for SearchSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more