pub struct DoubleParameter {
pub name: ParameterName,
pub domain: DoubleDomain,
pub constraints: Vec<DoubleConstraint>,
pub default: Option<f64>,
pub labels: Labels,
pub tags: Tags,
}Expand description
A parameter that observes an f64.
Fields§
§name: ParameterNameParameter name.
domain: DoubleDomainValue domain.
constraints: Vec<DoubleConstraint>Registered constraints.
default: Option<f64>Optional default value.
labels: LabelsIntrinsic facts.
Organisational tags.
Implementations§
Source§impl DoubleParameter
impl DoubleParameter
Sourcepub fn range(name: ParameterName, min: f64, max: f64) -> Result<Self>
pub fn range(name: ParameterName, min: f64, max: f64) -> Result<Self>
Construct a parameter backed by an inclusive range.
Sourcepub fn with_default(self, default: f64) -> Result<Self>
pub fn with_default(self, default: f64) -> Result<Self>
Set the default value. Rejects out-of-domain defaults and defaults that violate registered constraints.
Sourcepub fn with_constraint(self, c: DoubleConstraint) -> Self
pub fn with_constraint(self, c: DoubleConstraint) -> Self
Append a constraint.
Sourcepub fn with_label(self, key: LabelKey, value: LabelValue) -> Result<Self>
pub fn with_label(self, key: LabelKey, value: LabelValue) -> Result<Self>
Add a label. Rejects keys already used as a tag.
Trait Implementations§
Source§impl Attributed for DoubleParameter
impl Attributed for DoubleParameter
Source§impl Clone for DoubleParameter
impl Clone for DoubleParameter
Source§fn clone(&self) -> DoubleParameter
fn clone(&self) -> DoubleParameter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DoubleParameter
impl Debug for DoubleParameter
Source§impl<'de> Deserialize<'de> for DoubleParameter
impl<'de> Deserialize<'de> for DoubleParameter
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
Source§impl PartialEq for DoubleParameter
impl PartialEq for DoubleParameter
Source§impl Serialize for DoubleParameter
impl Serialize for DoubleParameter
impl StructuralPartialEq for DoubleParameter
Auto Trait Implementations§
impl Freeze for DoubleParameter
impl RefUnwindSafe for DoubleParameter
impl Send for DoubleParameter
impl Sync for DoubleParameter
impl Unpin for DoubleParameter
impl UnsafeUnpin for DoubleParameter
impl UnwindSafe for DoubleParameter
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