pub struct Constraints(/* private fields */);Expand description
Every constraint the steps so far defined, by name, each with the step
that defined it: gathered from their targets (Constraints::of).
Implementations§
Source§impl Constraints
impl Constraints
Sourcepub fn of(reader: &Reader<'_>) -> GeopResult<Self>
pub fn of(reader: &Reader<'_>) -> GeopResult<Self>
The constraints of the part reader reads: none where no step
defined any. A step whose constraints failed fails them all: a
solve must not go on without a constraint it could not make. A name
two steps defined is an error naming both.
Those of every instance placed in it come up behind the instance’s
name: a constraint c of the instance bolt is /bolt:c, on the
state /bolt:s where the instance’s is on s (see
[geop_core_program::instance]). A residual is the same wherever
the instance is: it is a length within it.
Sourcepub fn get(&self, name: &str) -> Option<&Constraint>
pub fn get(&self, name: &str) -> Option<&Constraint>
The constraint name, if a step defined it.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &Constraint)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &Constraint)>
Every constraint, in order of their names.
Sourcepub fn defining(&self) -> impl Iterator<Item = (&str, &DefinedAt)>
pub fn defining(&self) -> impl Iterator<Item = (&str, &DefinedAt)>
Where each is defined, in order of their names.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for Constraints
impl Clone for Constraints
Source§fn clone(&self) -> Constraints
fn clone(&self) -> Constraints
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more