add derive + docs

This commit is contained in:
JMARyA 2024-07-17 16:49:35 +02:00
parent 5da65fb603
commit ca2b0036f0
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
11 changed files with 400 additions and 43 deletions

View file

@ -1,7 +1,7 @@
/// This trait allows a `Model` to be validated.
pub trait Validate {
/// Validate the `Model`
async fn validate(&self) -> bool;
fn validate(&self) -> impl std::future::Future<Output = bool> + Send;
}
/// Validate a value and return `false` if validation fails.