pub struct EdifactValidator<E: ConditionEvaluator> { /* private fields */ }Expand description
Validates EDIFACT messages against AHB business rules.
The validator is a pure validation engine: it receives pre-parsed segments, an AHB workflow, and an external condition provider. Parsing and message-type detection are the caller’s responsibility.
The validator is generic over the ConditionEvaluator implementation,
which is typically generated from AHB XML schemas.
§Example
ⓘ
use automapper_validation::validator::EdifactValidator;
use automapper_validation::eval::NoOpExternalProvider;
let evaluator = UtilmdConditionEvaluatorFV2510::new();
let validator = EdifactValidator::new(evaluator);
let external = NoOpExternalProvider;
let report = validator.validate(
&segments,
&ahb_workflow,
&external,
ValidationLevel::Full,
);
if !report.is_valid() {
for error in report.errors() {
eprintln!("{error}");
}
}Implementations§
Source§impl<E: ConditionEvaluator> EdifactValidator<E>
impl<E: ConditionEvaluator> EdifactValidator<E>
Sourcepub fn validate(
&self,
segments: &[OwnedSegment],
workflow: &AhbWorkflow,
external: &dyn ExternalConditionProvider,
level: ValidationLevel,
) -> ValidationReport
pub fn validate( &self, segments: &[OwnedSegment], workflow: &AhbWorkflow, external: &dyn ExternalConditionProvider, level: ValidationLevel, ) -> ValidationReport
Validate with a group navigator for group-scoped condition queries.
Same as [validate] but passes a GroupNavigator to the
EvaluationContext, enabling conditions to query segments within
specific group instances (e.g., “in derselben SG8”).
Auto Trait Implementations§
impl<E> Freeze for EdifactValidator<E>where
E: Freeze,
impl<E> RefUnwindSafe for EdifactValidator<E>where
E: RefUnwindSafe,
impl<E> Send for EdifactValidator<E>
impl<E> Sync for EdifactValidator<E>
impl<E> Unpin for EdifactValidator<E>where
E: Unpin,
impl<E> UnsafeUnpin for EdifactValidator<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for EdifactValidator<E>where
E: UnwindSafe,
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