Skip to main content

Validate

Trait Validate 

Source
pub trait Validate {
    // Required method
    async fn validate_inner(&self, accum: &mut Accumulator);

    // Provided method
    async fn validate(&self) -> Result { ... }
}
Expand description

Trait for asynchronous validation.

Required Methods§

Source

async fn validate_inner(&self, accum: &mut Accumulator)

Accumulate validation errors.

Validators of containing types should call this; end users probably want Validate::validate instead.

Provided Methods§

Source

async fn validate(&self) -> Result

Perform top-level validation on this value.

Should not be called inside other validators; use Validate::validate_inner instead. Should not be overridden by implementors.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§