Struct cassowary::Solver [] [src]

pub struct Solver { /* fields omitted */ }

A constraint solver using the Cassowary algorithm. For proper usage please see the top level crate documentation.

Methods

impl Solver
[src]

Construct a new solver.

Add a constraint to the solver.

Remove a constraint from the solver.

Test whether a constraint has been added to the solver.

Add an edit variable to the solver.

This method should be called before the suggest_value method is used to supply a suggested value for the given edit variable.

Remove an edit variable from the solver.

Test whether an edit variable has been added to the solver.

Suggest a value for the given edit variable.

This method should be used after an edit variable has been added to the solver in order to suggest the value for that variable.

Fetches all changes to the values of variables since the last call to this function.

The list of changes returned is not in a specific order. Each change comprises the variable changed and the new value of that variable.

Reset the solver to the empty starting condition.

This method resets the internal solver state to the empty starting condition, as if no constraints or edit variables have been added. This can be faster than deleting the solver and creating a new one when the entire system must change, since it can avoid unnecessary heap (de)allocations.

Get the stored value for a variable.

Normally values should be retrieved and updated using fetch_changes, but this method can be used for debugging or testing.

Trait Implementations

Auto Trait Implementations

impl !Send for Solver

impl !Sync for Solver