pub enum ParameterConstraint {
Equality {
param: String,
value: ParameterValue,
condition_param: String,
condition_value: ParameterValue,
},
Inequality {
param: String,
value: ParameterValue,
condition_param: String,
condition_value: ParameterValue,
},
Range {
param: String,
min_value: ParameterValue,
max_value: ParameterValue,
condition_param: String,
condition_value: ParameterValue,
},
MutualExclusion {
param1: String,
value1: ParameterValue,
param2: String,
value2: ParameterValue,
},
Custom {
name: String,
constraint_fn: Arc<dyn Fn(&ParameterSet) -> bool + Send + Sync>,
},
}Expand description
Parameter constraint type
Variants§
Equality
Equality constraint: param1 == value when param2 == condition
Inequality
Inequality constraint: param1 != value when param2 == condition
Range
Range constraint: param1 in range when param2 == condition
MutualExclusion
Mutual exclusion: if param1 == value1, then param2 != value2
Custom
Custom constraint function
Implementations§
Source§impl ParameterConstraint
impl ParameterConstraint
Sourcepub fn is_satisfied(&self, params: &ParameterSet) -> bool
pub fn is_satisfied(&self, params: &ParameterSet) -> bool
Check if a parameter set satisfies this constraint
Trait Implementations§
Source§impl Clone for ParameterConstraint
impl Clone for ParameterConstraint
Source§fn clone(&self) -> ParameterConstraint
fn clone(&self) -> ParameterConstraint
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 moreAuto Trait Implementations§
impl Freeze for ParameterConstraint
impl !RefUnwindSafe for ParameterConstraint
impl Send for ParameterConstraint
impl Sync for ParameterConstraint
impl Unpin for ParameterConstraint
impl !UnwindSafe for ParameterConstraint
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<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