Struct cassowary::Constraint
[−]
[src]
pub struct Constraint(_);
A constraint, consisting of an equation goverened by an expression and a relational operator, and an associated strength.
Methods
impl Constraint
[src]
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.
fn expr(&self) -> &Expression
The expression of the left hand side of the constraint equation.
fn op(&self) -> RelationalOperator
The relational operator governing the constraint.
fn strength(&self) -> f64
The strength of the constraint that the solver will use.
Trait Implementations
impl Debug for Constraint
[src]
impl Clone for Constraint
[src]
fn clone(&self) -> Constraint
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Hash for Constraint
[src]
fn hash<H: Hasher>(&self, hasher: &mut H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl PartialEq for Constraint
[src]
fn eq(&self, other: &Constraint) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.