Skip to main content

Validate

Trait Validate 

Source
pub trait Validate: Sized {
    // Required method
    fn validate_with_config(
        &self,
        config: &ValidationConfig,
        errors: &mut Vec<ValidationError>,
    );

    // Provided methods
    fn validate_and_return_first_error(&self) -> Result<(), ValidationError> { ... }
    fn validate(&self, errors: &mut Vec<ValidationError>) { ... }
}
Expand description

Validate an object

This trait is used automatically when inserting an object into a store.

Required Methods§

Source

fn validate_with_config( &self, config: &ValidationConfig, errors: &mut Vec<ValidationError>, )

Validate the object

Provided Methods§

Source

fn validate_and_return_first_error(&self) -> Result<(), ValidationError>

Validate the object using default config and return on first error

Source

fn validate(&self, errors: &mut Vec<ValidationError>)

Validate the object using default configuration

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§