pub enum ConstraintExpr<'a> {
All {
all: Vec<ConstraintNode<'a>>,
},
Any {
any: Vec<ConstraintNode<'a>>,
},
Enumerate {
enumerate: Vec<ConstraintNode<'a>>,
},
}Expand description
Constraint expression tree: a list of types/expressions under all, any, or enumerate.
Variants§
All
All children must be satisfied
Fields
all: Vec<ConstraintNode<'a>>Children nodes that must all be satisfied
Any
Any child may satisfy the expression
Fields
any: Vec<ConstraintNode<'a>>Children nodes where any one must be satisfied
Enumerate
All satisfiable children should be selected
Fields
enumerate: Vec<ConstraintNode<'a>>Children nodes to evaluate and collect if satisfiable
Implementations§
Source§impl ConstraintExpr<'_>
impl ConstraintExpr<'_>
Sourcepub fn evaluate<F>(&self, has_type: &F) -> bool
pub fn evaluate<F>(&self, has_type: &F) -> bool
Evaluate the constraint against a predicate that reports whether a issuer schema id was provided successfully
Sourcepub fn validate_max_depth(&self, max_depth: usize) -> bool
pub fn validate_max_depth(&self, max_depth: usize) -> bool
Validate the maximum nesting depth. Depth counts the number of Expr nodes encountered. A flat list has depth 1. Allow at most 2 (one nested level under root).
Sourcepub fn validate_max_nodes(&self, max_nodes: usize) -> bool
pub fn validate_max_nodes(&self, max_nodes: usize) -> bool
Validate the maximum total number of nodes in the constraint AST.
Counts both expression containers and leaf type nodes. Short-circuits
once the running total exceeds max_nodes to avoid full traversal.
Trait Implementations§
Source§impl<'a> Clone for ConstraintExpr<'a>
impl<'a> Clone for ConstraintExpr<'a>
Source§fn clone(&self) -> ConstraintExpr<'a>
fn clone(&self) -> ConstraintExpr<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for ConstraintExpr<'a>
impl<'a> Debug for ConstraintExpr<'a>
Source§impl<'de, 'a> Deserialize<'de> for ConstraintExpr<'a>
impl<'de, 'a> Deserialize<'de> for ConstraintExpr<'a>
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>,
Source§impl<'a> PartialEq for ConstraintExpr<'a>
impl<'a> PartialEq for ConstraintExpr<'a>
Source§impl<'a> Serialize for ConstraintExpr<'a>
impl<'a> Serialize for ConstraintExpr<'a>
impl<'a> Eq for ConstraintExpr<'a>
impl<'a> StructuralPartialEq for ConstraintExpr<'a>
Auto Trait Implementations§
impl<'a> Freeze for ConstraintExpr<'a>
impl<'a> RefUnwindSafe for ConstraintExpr<'a>
impl<'a> Send for ConstraintExpr<'a>
impl<'a> Sync for ConstraintExpr<'a>
impl<'a> Unpin for ConstraintExpr<'a>
impl<'a> UnsafeUnpin for ConstraintExpr<'a>
impl<'a> UnwindSafe for ConstraintExpr<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more