pub struct ParallelConstraintValidator { /* private fields */ }Expand description
Validates all constraints in a shape concurrently.
Independent constraints (those without shape-level cross-dependencies) are distributed across Rayon worker threads. This is particularly effective for shapes with many property constraints (e.g., sh:minCount, sh:maxCount, sh:pattern, sh:datatype) where each constraint is independent.
Implementations§
Source§impl ParallelConstraintValidator
impl ParallelConstraintValidator
Sourcepub fn new(config: ParallelConstraintConfig) -> Self
pub fn new(config: ParallelConstraintConfig) -> Self
Create a new parallel validator with the given configuration.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create with default configuration.
Sourcepub fn validate_shape<F>(
&self,
shape: &Shape,
context: &ConstraintContext,
constraint_evaluator: F,
) -> Result<ParallelValidationSummary>where
F: Fn(&ConstraintComponentId, &Constraint, &ConstraintContext) -> Result<ConstraintEvaluationResult> + Send + Sync,
pub fn validate_shape<F>(
&self,
shape: &Shape,
context: &ConstraintContext,
constraint_evaluator: F,
) -> Result<ParallelValidationSummary>where
F: Fn(&ConstraintComponentId, &Constraint, &ConstraintContext) -> Result<ConstraintEvaluationResult> + Send + Sync,
Validate all constraints in shape against the provided context.
constraint_evaluator is a closure that evaluates a single constraint.
It takes (component_id, constraint, context) and returns a Result.
The closure must be Send + Sync because it may be invoked from
multiple Rayon threads concurrently.
Sourcepub fn validate_nodes<F>(
&self,
shape: &Shape,
contexts: &[ConstraintContext],
constraint_evaluator: F,
) -> Result<Vec<ParallelValidationSummary>>where
F: Fn(&ConstraintComponentId, &Constraint, &ConstraintContext) -> Result<ConstraintEvaluationResult> + Send + Sync,
pub fn validate_nodes<F>(
&self,
shape: &Shape,
contexts: &[ConstraintContext],
constraint_evaluator: F,
) -> Result<Vec<ParallelValidationSummary>>where
F: Fn(&ConstraintComponentId, &Constraint, &ConstraintContext) -> Result<ConstraintEvaluationResult> + Send + Sync,
Validate multiple focus nodes against a single shape in parallel.
Each focus node is validated in its own Rayon task. This is useful when validating a large number of independent nodes against the same shape.
Auto Trait Implementations§
impl Freeze for ParallelConstraintValidator
impl RefUnwindSafe for ParallelConstraintValidator
impl Send for ParallelConstraintValidator
impl Sync for ParallelConstraintValidator
impl Unpin for ParallelConstraintValidator
impl UnsafeUnpin for ParallelConstraintValidator
impl UnwindSafe for ParallelConstraintValidator
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.