Trait Constraint

Source
pub trait Constraint:
    Debug
    + Send
    + Sync {
    // Required methods
    fn description(&self) -> &'static str;
    fn satisfied(&self, ty: &Type) -> bool;
}
Expand description

A trait implemented by type constraints.

Required Methods§

Source

fn description(&self) -> &'static str

Gets a description of the constraint.

Source

fn satisfied(&self, ty: &Type) -> bool

Determines if the given type satisfies the constraint.

Returns true if the constraint is satisfied or false if not.

Implementors§