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 Methods 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]

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]

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> ConstraintSpec for Constraint<T>[src]

type Method = Method<T>

The type of the methods of the constraint.

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.

impl<T> Debug for Constraint<T> where
    T: Debug
[src]

impl<T> Index<&'_ str> for Constraint<T>[src]

type Output = Method<T>

The returned type after indexing.

impl<T> PartialEq<Constraint<T>> for Constraint<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Constraint<T>

impl<T> !Send for Constraint<T>

impl<T> !Sync for Constraint<T>

impl<T> Unpin for Constraint<T>

impl<T> !UnwindSafe for Constraint<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.