pub struct TypesIntentConstraint {
pub key: ConstraintName,
pub value: ConstraintValue,
pub severity: ConstraintSeverity,
}Expand description
Constraint on intent execution.
Uses “Types” prefix to avoid collision with existing IntentConstraint.
Fields§
§key: ConstraintNameConstraint key.
value: ConstraintValueConstraint value.
severity: ConstraintSeverityHow violations are handled.
Implementations§
Source§impl TypesIntentConstraint
impl TypesIntentConstraint
Sourcepub fn new(
key: impl Into<ConstraintName>,
value: impl Into<ConstraintValue>,
severity: ConstraintSeverity,
) -> TypesIntentConstraint
pub fn new( key: impl Into<ConstraintName>, value: impl Into<ConstraintValue>, severity: ConstraintSeverity, ) -> TypesIntentConstraint
Create a new constraint.
Sourcepub fn hard(
key: impl Into<ConstraintName>,
value: impl Into<ConstraintValue>,
) -> TypesIntentConstraint
pub fn hard( key: impl Into<ConstraintName>, value: impl Into<ConstraintValue>, ) -> TypesIntentConstraint
Create a hard constraint.
Sourcepub fn soft(
key: impl Into<ConstraintName>,
value: impl Into<ConstraintValue>,
) -> TypesIntentConstraint
pub fn soft( key: impl Into<ConstraintName>, value: impl Into<ConstraintValue>, ) -> TypesIntentConstraint
Create a soft constraint.
Trait Implementations§
Source§impl Clone for TypesIntentConstraint
impl Clone for TypesIntentConstraint
Source§fn clone(&self) -> TypesIntentConstraint
fn clone(&self) -> TypesIntentConstraint
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 moreSource§impl Debug for TypesIntentConstraint
impl Debug for TypesIntentConstraint
Source§impl<'de> Deserialize<'de> for TypesIntentConstraint
impl<'de> Deserialize<'de> for TypesIntentConstraint
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TypesIntentConstraint, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TypesIntentConstraint, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for TypesIntentConstraint
impl Serialize for TypesIntentConstraint
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for TypesIntentConstraint
impl RefUnwindSafe for TypesIntentConstraint
impl Send for TypesIntentConstraint
impl Sync for TypesIntentConstraint
impl Unpin for TypesIntentConstraint
impl UnsafeUnpin for TypesIntentConstraint
impl UnwindSafe for TypesIntentConstraint
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