pub struct BooleanParameter {
pub name: ParameterName,
pub constraints: Vec<BoolConstraint>,
pub default: Option<bool>,
pub labels: Labels,
pub tags: Tags,
}Expand description
A parameter that observes a bool.
Fields§
§name: ParameterNameParameter name.
constraints: Vec<BoolConstraint>Registered constraints.
default: Option<bool>Optional default value.
labels: LabelsIntrinsic facts.
Organisational tags.
Implementations§
Source§impl BooleanParameter
impl BooleanParameter
Sourcepub fn of(name: ParameterName) -> Self
pub fn of(name: ParameterName) -> Self
Construct a new boolean parameter.
Sourcepub fn with_default(self, default: bool) -> Result<Self>
pub fn with_default(self, default: bool) -> Result<Self>
Set the default. Rejects if a registered constraint forbids it.
Sourcepub fn with_constraint(self, c: BoolConstraint) -> Self
pub fn with_constraint(self, c: BoolConstraint) -> 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.
Trait Implementations§
Source§impl Attributed for BooleanParameter
impl Attributed for BooleanParameter
Source§impl Clone for BooleanParameter
impl Clone for BooleanParameter
Source§fn clone(&self) -> BooleanParameter
fn clone(&self) -> BooleanParameter
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 BooleanParameter
impl Debug for BooleanParameter
Source§impl<'de> Deserialize<'de> for BooleanParameter
impl<'de> Deserialize<'de> for BooleanParameter
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 BooleanParameter
impl PartialEq for BooleanParameter
Source§impl Serialize for BooleanParameter
impl Serialize for BooleanParameter
impl Eq for BooleanParameter
impl StructuralPartialEq for BooleanParameter
Auto Trait Implementations§
impl Freeze for BooleanParameter
impl RefUnwindSafe for BooleanParameter
impl Send for BooleanParameter
impl Sync for BooleanParameter
impl Unpin for BooleanParameter
impl UnsafeUnpin for BooleanParameter
impl UnwindSafe for BooleanParameter
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.