Struct cassowary::Constraint
[−]
[src]
pub struct Constraint(_);
A constraint, consisting of an equation governed by an expression and a relational operator, and an associated strength.
Methods
impl Constraint[src]
impl Constraintpub fn new(e: Expression, op: RelationalOperator, strength: f64) -> Constraint[src]
pub fn new(e: Expression, op: RelationalOperator, strength: f64) -> ConstraintConstruct 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.
pub fn expr(&self) -> &Expression[src]
pub fn expr(&self) -> &ExpressionThe expression of the left hand side of the constraint equation.
pub fn op(&self) -> RelationalOperator[src]
pub fn op(&self) -> RelationalOperatorThe relational operator governing the constraint.
pub fn strength(&self) -> f64[src]
pub fn strength(&self) -> f64The strength of the constraint that the solver will use.
Trait Implementations
impl Clone for Constraint[src]
impl Clone for Constraintfn clone(&self) -> Constraint[src]
fn clone(&self) -> ConstraintReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for Constraint[src]
impl Debug for Constraintfn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
fn fmt(&self, __arg_0: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Hash for Constraint[src]
impl Hash for Constraintfn hash<H: Hasher>(&self, hasher: &mut H)[src]
fn hash<H: Hasher>(&self, hasher: &mut H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl PartialEq for Constraint[src]
impl PartialEq for Constraintfn eq(&self, other: &Constraint) -> bool[src]
fn eq(&self, other: &Constraint) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl Eq for Constraint[src]
impl Eq for ConstraintAuto Trait Implementations
impl Send for Constraint
impl Send for Constraintimpl Sync for Constraint
impl Sync for Constraint