pub trait AsyncValidator: Send + Sync {
// Required method
fn validate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
value: &'life1 str,
record_id: Option<&'life2 Value>,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Asynchronous field validator. Used for validators that need DB access (e.g. Unique).
record_id is the current record’s PK — pass Some on edit, None on create.