[][src]Trait form_validation::Validatable

pub trait Validatable<Key> {
    fn validate(&self) -> Result<(), ValidationErrors<Key>>;

    fn validate_or_empty(&self) -> ValidationErrors<Key> { ... }
}

An item that can be validated.

Required methods

fn validate(&self) -> Result<(), ValidationErrors<Key>>

Validate this item. Returns Ok(()) if no errors were encountered, and returns Err(ValidationErrors) if any errors were encountered.

Loading content...

Provided methods

fn validate_or_empty(&self) -> ValidationErrors<Key>

Validate this item. Returns an empty ValidationErrors if no errors were encountered during validation.

Loading content...

Implementors

Loading content...