pub trait Validate {
// Required method
fn validate(&self) -> Result<(), ValidationError>;
}Required Methods§
Sourcefn validate(&self) -> Result<(), ValidationError>
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. Callers typically map this to
ConnectError::invalid_argument via
ValidationError::into_connect_error (requires the connect feature).