pub trait Form {
type Data: Clone + Send;
Show 21 methods
// Required methods
fn new() -> Self
where Self: Sized;
fn attrs(&self) -> &Attributes;
fn csrf_token(&self) -> Option<&String>;
fn insert_attr(self, key: &str, value: &str) -> Self
where Self: Sized;
fn post(&mut self, token: &TokenRef<'_>);
fn from_data<'async_trait>(
data: Self::Data
) -> Pin<Box<dyn Future<Output = Self> + Send + 'async_trait>>
where Self: Sized + 'async_trait;
fn from_get<B: BaseRequest>(req: &mut B) -> Result<Self>
where Self: Sized;
fn from_post<B: BaseRequest + CsrfDefense>(req: &mut B) -> Result<Self>
where Self: Sized;
fn fill(&mut self) -> Result<()>
where Self: Sized;
fn validate(&mut self) -> Result<Self::Data>;
fn errors(&self) -> &FormErrors;
fn add_error(&mut self, e: Box<dyn Error + Send + Sync>);
fn set_data(&mut self, data: Option<Self::Data>);
fn field_names() -> &'static [&'static str];
fn field(&self, n: usize) -> Option<&dyn Field>;
// Provided methods
fn token_tag(&self) -> Option<String> { ... }
fn tag(&self) -> String { ... }
fn action<B: BaseRequest + Reverse>(self, req: &B, action: View<B>) -> Self
where Self: Sized { ... }
fn class(self, class: &str) -> Self
where Self: Sized { ... }
fn id(self, id: &str) -> Self
where Self: Sized { ... }
fn submit(&self, value: &str) -> String { ... }
}