Skip to main content

Validate

Trait Validate 

Source
pub trait Validate {
    // Required method
    fn validate(&self) -> Errors;

    // Provided method
    fn is_valid(&self) -> bool { ... }
}
Expand description

Implemented by models that can validate themselves.

Required Methods§

Source

fn validate(&self) -> Errors

Collect validation errors for the current state.

Provided Methods§

Source

fn is_valid(&self) -> bool

Whether the record currently passes validation.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§