pub trait FormPartial {
type Form: Form<Partial = Self>;
type Validation: FormValidation<Partial = Self>;
type Error: Send + 'static;
const INFO: &'static FormPartialInfo;
// Required methods
fn form(&self) -> Result<Self::Form, &'static str>
where Self: Sized;
fn validate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Validation, Self::Error>> + Send + 'async_trait>>
where Self: Sized + 'async_trait,
'life0: 'async_trait;
// Provided method
fn validator_info(&self) -> &'static FormPartialInfo { ... }
}Expand description
The type of a partially populated and as-yet-unvalidated form. Structs for and implementations of this trait can be generated via derive macro.
Required Associated Constants§
const INFO: &'static FormPartialInfo
Required Associated Types§
type Form: Form<Partial = Self>
type Validation: FormValidation<Partial = Self>
type Error: Send + 'static
Required Methods§
Sourcefn validate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Validation, Self::Error>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
'life0: 'async_trait,
fn validate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Validation, Self::Error>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
'life0: 'async_trait,
Runs all the validators on the form and calculates errors.
Should only be called once.
§Errors
Returns direct errors from validators if one was thrown.
Provided Methods§
fn validator_info(&self) -> &'static FormPartialInfo
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".