Skip to main content

NormalizeAndValidate

Trait NormalizeAndValidate 

Source
pub trait NormalizeAndValidate: Visitable + Sized {
    // Provided method
    fn normalize_and_validate(self) -> Result<Self, VisitorError> { ... }
}
Expand description

Consuming normalize-then-validate convenience for application values.

The value is normalized first. Validation runs only if normalization succeeds, and the normalized value is returned only after both traversals succeed. The method consumes self, so it neither clones the value nor creates a second callback owner.

Provided Methods§

Source

fn normalize_and_validate(self) -> Result<Self, VisitorError>

Normalize and then validate this application-owned value.

§Errors

Returns a typed VisitorError from the first failing stage. Use VisitorError::operation to distinguish normalization from validation without inspecting diagnostic prose.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§