Trait Validation

Source
pub trait Validation<Value, Key> {
    // Required method
    fn validate_value(
        &self,
        value: &Value,
        key: &Key,
    ) -> Result<(), ValidationErrors<Key>>;
}
Expand description

A function/struct/item that can perform validation on an item with a given Value type.

Required Methods§

Source

fn validate_value( &self, value: &Value, key: &Key, ) -> Result<(), ValidationErrors<Key>>

Validate a given form field referenced by a given Key, that contains a given Value, returns ValidationErrors if there are any.

Implementors§

Source§

impl<Value, Key> Validation<Value, Key> for Validator<Value, Key>
where Key: PartialEq + Clone,

Source§

impl<Value, Key> Validation<Value, Key> for ValidatorFn<Value, Key>
where Key: Clone + PartialEq,