pub struct IntegerParameter {
pub name: ParameterName,
pub domain: IntegerDomain,
pub constraints: Vec<IntConstraint>,
pub default: Option<i64>,
pub labels: Labels,
pub tags: Tags,
}Expand description
A parameter that observes an i64.
Fields§
§name: ParameterNameParameter name.
domain: IntegerDomainValue domain.
constraints: Vec<IntConstraint>Registered constraints; all must hold.
default: Option<i64>Optional default value.
labels: LabelsIntrinsic-fact map.
Organisational tag map.
Implementations§
Source§impl IntegerParameter
impl IntegerParameter
Sourcepub fn range(name: ParameterName, min: i64, max: i64) -> Result<Self>
pub fn range(name: ParameterName, min: i64, max: i64) -> Result<Self>
Construct a parameter backed by an inclusive numeric range.
Sourcepub fn of(name: ParameterName, values: BTreeSet<i64>) -> Result<Self>
pub fn of(name: ParameterName, values: BTreeSet<i64>) -> Result<Self>
Construct a parameter backed by a discrete value set.
Sourcepub fn with_default(self, default: i64) -> Result<Self>
pub fn with_default(self, default: i64) -> Result<Self>
Set the default value. Rejects out-of-domain defaults and defaults that violate registered constraints.
Sourcepub fn with_constraint(self, c: IntConstraint) -> Self
pub fn with_constraint(self, c: IntConstraint) -> 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 on this parameter.
Trait Implementations§
Source§impl Attributed for IntegerParameter
impl Attributed for IntegerParameter
Source§impl Clone for IntegerParameter
impl Clone for IntegerParameter
Source§fn clone(&self) -> IntegerParameter
fn clone(&self) -> IntegerParameter
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 IntegerParameter
impl Debug for IntegerParameter
Source§impl<'de> Deserialize<'de> for IntegerParameter
impl<'de> Deserialize<'de> for IntegerParameter
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 IntegerParameter
impl PartialEq for IntegerParameter
Source§impl Serialize for IntegerParameter
impl Serialize for IntegerParameter
impl Eq for IntegerParameter
impl StructuralPartialEq for IntegerParameter
Auto Trait Implementations§
impl Freeze for IntegerParameter
impl RefUnwindSafe for IntegerParameter
impl Send for IntegerParameter
impl Sync for IntegerParameter
impl Unpin for IntegerParameter
impl UnsafeUnpin for IntegerParameter
impl UnwindSafe for IntegerParameter
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.