pub struct Constraint(/* private fields */);
Expand description
A constraint, consisting of an equation governed by an expression and a relational operator, and an associated strength.
Implementations§
Source§impl Constraint
impl Constraint
Sourcepub fn new(e: Expression, op: RelationalOperator, strength: f64) -> Constraint
pub fn new(e: Expression, op: RelationalOperator, strength: f64) -> Constraint
Construct a new constraint from an expression, a relational operator and a strength.
This corresponds to the equation e op 0.0
, e.g. x + y >= 0.0
. For equations with a non-zero
right hand side, subtract it from the equation to give a zero right hand side.
Sourcepub fn expr(&self) -> &Expression
pub fn expr(&self) -> &Expression
The expression of the left hand side of the constraint equation.
Sourcepub fn op(&self) -> RelationalOperator
pub fn op(&self) -> RelationalOperator
The relational operator governing the constraint.
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
Source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
Returns a copy 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 Constraint
impl Debug for Constraint
Source§impl Hash for Constraint
impl Hash for Constraint
Source§impl PartialEq for Constraint
impl PartialEq for Constraint
impl Eq for Constraint
Auto Trait Implementations§
impl Freeze for Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)