Skip to main content

Validate

Trait Validate 

Source
pub trait Validate {
    // Required method
    fn validate(&self) -> Result<(), ValidationError>;
}

Required Methods§

Source

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

Runs every rule attached to this message (and any nested messages), collecting violations rather than short-circuiting on the first.

§Errors

Returns a ValidationError containing one or more Violations when any rule fails, or compilation/evaluation diagnostics when a rule cannot run. For RPC requests, ValidationError::into_connect_error (the connect feature) maps violations to invalid_argument and validator defects to internal.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§