Trait hotdrink_rs::planner::ConstraintSpec [−][src]
pub trait ConstraintSpec { type Method: MethodSpec; fn new(methods: Vec<Self::Method>) -> Self; fn name(&self) -> &str; fn methods(&self) -> &[Self::Method]; fn add_method(&mut self, m: Self::Method); fn remove_method(&mut self, name: &str); fn variables(&self) -> &[usize]; fn is_active(&self) -> bool; }
A trait for objects that can act as constraints in a constraint system.
Associated Types
type Method: MethodSpec
[src]
The type of the methods of the constraint.
Required methods
fn new(methods: Vec<Self::Method>) -> Self
[src]
Constructs a new constraint with the provided methods.
fn name(&self) -> &str
[src]
Returns a reference to the name of the constraint.
fn methods(&self) -> &[Self::Method]
[src]
Returns a slice to the methods of the constraint.
fn add_method(&mut self, m: Self::Method)
[src]
Adds a new method to the constraint.
fn remove_method(&mut self, name: &str)
[src]
Removes a method from the constraint.
fn variables(&self) -> &[usize]
[src]
Returns a slice to the variables used by the methods of the constraint.
fn is_active(&self) -> bool
[src]
Whether or not this constraint is active.
Implementors
impl<T> ConstraintSpec for Constraint<T>
[src]
impl<T> ConstraintSpec for Constraint<T>
[src]type Method = Method<T>
fn new(methods: Vec<Self::Method>) -> Self
[src]
fn name(&self) -> &str
[src]
fn methods(&self) -> &[Self::Method]
[src]
fn add_method(&mut self, m: Method<T>)
[src]
fn remove_method(&mut self, name: &str)
[src]
Remove a method from the constraint system.
Panics
Panics if the method does not exit, or if the name is ambiguous.