pub enum DimConstraint {
Eq(IndexExpr, IndexExpr),
Lt(IndexExpr, IndexExpr),
Lte(IndexExpr, IndexExpr),
Gt(IndexExpr, IndexExpr),
Gte(IndexExpr, IndexExpr),
And(Box<DimConstraint>, Box<DimConstraint>),
Or(Box<DimConstraint>, Box<DimConstraint>),
Not(Box<DimConstraint>),
}Expand description
Dimension constraints for dependent types.
Variants§
Eq(IndexExpr, IndexExpr)
Equality: e1 == e2
Lt(IndexExpr, IndexExpr)
Less than: e1 < e2
Lte(IndexExpr, IndexExpr)
Less than or equal: e1 <= e2
Gt(IndexExpr, IndexExpr)
Greater than: e1 > e2
Gte(IndexExpr, IndexExpr)
Greater than or equal: e1 >= e2
And(Box<DimConstraint>, Box<DimConstraint>)
Conjunction: c1 ∧ c2
Or(Box<DimConstraint>, Box<DimConstraint>)
Disjunction: c1 ∨ c2
Not(Box<DimConstraint>)
Negation: ¬c
Implementations§
Source§impl DimConstraint
impl DimConstraint
pub fn eq(left: IndexExpr, right: IndexExpr) -> Self
pub fn lt(left: IndexExpr, right: IndexExpr) -> Self
pub fn lte(left: IndexExpr, right: IndexExpr) -> Self
pub fn gt(left: IndexExpr, right: IndexExpr) -> Self
pub fn gte(left: IndexExpr, right: IndexExpr) -> Self
pub fn and(left: DimConstraint, right: DimConstraint) -> Self
pub fn or(left: DimConstraint, right: DimConstraint) -> Self
pub fn not(constraint: DimConstraint) -> Self
Sourcepub fn referenced_vars(&self) -> HashSet<String>
pub fn referenced_vars(&self) -> HashSet<String>
Get all index variables referenced in this constraint
Sourcepub fn simplify(&self) -> DimConstraint
pub fn simplify(&self) -> DimConstraint
Simplify the constraint
Trait Implementations§
Source§impl Clone for DimConstraint
impl Clone for DimConstraint
Source§fn clone(&self) -> DimConstraint
fn clone(&self) -> DimConstraint
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DimConstraint
impl Debug for DimConstraint
Source§impl<'de> Deserialize<'de> for DimConstraint
impl<'de> Deserialize<'de> for DimConstraint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for DimConstraint
impl Display for DimConstraint
Source§impl Hash for DimConstraint
impl Hash for DimConstraint
Source§impl PartialEq for DimConstraint
impl PartialEq for DimConstraint
Source§impl Serialize for DimConstraint
impl Serialize for DimConstraint
impl Eq for DimConstraint
impl StructuralPartialEq for DimConstraint
Auto Trait Implementations§
impl Freeze for DimConstraint
impl RefUnwindSafe for DimConstraint
impl Send for DimConstraint
impl Sync for DimConstraint
impl Unpin for DimConstraint
impl UnwindSafe for DimConstraint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more