pub enum Constraint {
MinRelative {
source: String,
target: String,
factor: f32,
offset: f32,
},
MaxRelative {
source: String,
target: String,
factor: f32,
offset: f32,
},
Driven {
source: String,
target: String,
factor: f32,
offset: f32,
},
SumEquals {
params: Vec<String>,
total: f32,
},
Clamp {
param: String,
min: f32,
max: f32,
},
MaxSum {
param_a: String,
param_b: String,
max_sum: f32,
},
Conditional {
condition: String,
threshold: f32,
target: String,
value: f32,
},
}Expand description
Constraint types between parameters.
Variants§
MinRelative
target must be >= source * factor + offset
MaxRelative
target must be <= source * factor + offset
Driven
target = source * factor + offset (hard link), clamped to [0, 1]
SumEquals
sum of named params must equal total (redistributes proportionally)
Clamp
param must be in [min, max]
MaxSum
param_a + param_b <= max_sum
Conditional
if condition_param >= threshold, then target_param gets assigned value
Implementations§
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
Source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
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 Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnsafeUnpin for Constraint
impl UnwindSafe for Constraint
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