pub struct DimConstraint {
pub lhs: DimExpr,
pub relation: DimRelation,
pub rhs: DimExpr,
pub message: Option<String>,
}Expand description
A constraint between dimension expressions.
Fields§
§lhs: DimExprLeft-hand side expression
relation: DimRelationConstraint relation
rhs: DimExprRight-hand side expression
message: Option<String>Error message if constraint is violated
Implementations§
Source§impl DimConstraint
impl DimConstraint
Sourcepub fn new(lhs: DimExpr, relation: DimRelation, rhs: DimExpr) -> Self
pub fn new(lhs: DimExpr, relation: DimRelation, rhs: DimExpr) -> Self
Create a new dimension constraint.
Sourcepub fn with_message(self, message: impl Into<String>) -> Self
pub fn with_message(self, message: impl Into<String>) -> Self
Set the error message.
Sourcepub fn check(&self, ctx: &DependentTypeContext) -> bool
pub fn check(&self, ctx: &DependentTypeContext) -> bool
Check if the constraint is satisfied.
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 moreAuto 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