Skip to main content

Validatable

Trait Validatable 

Source
pub trait Validatable {
    type Error;

    // Required method
    fn validate(&self) -> Result<(), Self::Error>;
}
Expand description

A trait indicating that an entity class can be validated

This trait is used for validating the data of objects.

Required Associated Types§

Source

type Error

Validation error type

Required Methods§

Source

fn validate(&self) -> Result<(), Self::Error>

Validates whether the data of this entity is valid

§Returns

Ok(()) if the data is valid; otherwise returns Err containing the validation error

Implementors§