pub trait FormRequest: Send + Sync {
type Data: for<'de> Deserialize<'de>;
// Required methods
fn rules(&self) -> HashMap<String, Vec<Box<dyn ValidationRule>>>;
fn validate<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 Self::Data,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn authorize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn messages(&self) -> HashMap<String, String> { ... }
}
Expand description
Trait for form requests (validation and authorization)
Required Associated Types§
Sourcetype Data: for<'de> Deserialize<'de>
type Data: for<'de> Deserialize<'de>
Request data type