Struct hotdrink_rs::model::Constraint [−][src]
pub struct Constraint<T> { /* fields omitted */ }
Represents a constraint in a multiway dataflow constraint system.
It has a name, a set of variables it references, a set of Method
s to enforce it,
and an optional assertion to run to ensure that it is actually enforced upon running a method.
Implementations
impl<T> Constraint<T>
[src]
impl<T> Constraint<T>
[src]pub fn new_empty(name: String) -> Self
[src]
Constructs a new Constraint
with no methods.
pub fn new_with_name(name: String, methods: Vec<Method<T>>) -> Self
[src]
Constructs a new Constraint
with the specified name.
pub fn new_with_name_and_assert(
name: String,
methods: Vec<Method<T>>,
assert: Option<Arc<dyn Fn(&[T]) -> bool>>
) -> Self
[src]
name: String,
methods: Vec<Method<T>>,
assert: Option<Arc<dyn Fn(&[T]) -> bool>>
) -> Self
Constructs a new Component
with the specified name and assertion.
pub fn set_active(&mut self, active: bool)
[src]
Enables or disables the constraint.
This decides if the constraint should be enforced during planning.
Trait Implementations
impl<T> Clone for Constraint<T>
[src]
impl<T> Clone for Constraint<T>
[src]fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> ConstraintSpec for Constraint<T>
[src]
impl<T> ConstraintSpec for Constraint<T>
[src]type Method = Method<T>
The type of the methods of the constraint.
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.
fn variables(&self) -> &[usize]
[src]
fn is_active(&self) -> bool
[src]
impl<T> Debug for Constraint<T> where
T: Debug,
[src]
impl<T> Debug for Constraint<T> where
T: Debug,
[src]impl<T> Index<&'_ str> for Constraint<T>
[src]
impl<T> Index<&'_ str> for Constraint<T>
[src]Auto Trait Implementations
impl<T> !RefUnwindSafe for Constraint<T>
impl<T> !RefUnwindSafe for Constraint<T>
impl<T> !Send for Constraint<T>
impl<T> !Send for Constraint<T>
impl<T> !Sync for Constraint<T>
impl<T> !Sync for Constraint<T>
impl<T> Unpin for Constraint<T>
impl<T> Unpin for Constraint<T>
impl<T> !UnwindSafe for Constraint<T>
impl<T> !UnwindSafe for Constraint<T>