[−][src]Struct form_data::Form
A structure that defines the fields expected in form data
Example
let form = Form::new() .field("field-name", Field::text()) .field("second-field", Field::int()) .field("third-field", Field::float()) .field("fourth-field", Field::bytes()) .field("fifth-field", Field::file(name_generator)) .field( "map-field", Field::map() .field("sub-field", Field::text()) .field("sub-field-two", Field::text()) .finalize() ) .field( "array-field", Field::array(Field::text()) );
Fields
max_fields: u32
max_field_size: usize
max_files: u32
max_file_size: usize
Methods
impl Form
[src]
pub fn new() -> Self
[src]
Create a new form
If you wish to provide your own executor, use the with_executor
method.
pub fn max_fields(self, max: u32) -> Self
[src]
Set the maximum number of fields allowed in the upload
The upload will error if too many fields are provided.
pub fn max_field_size(self, max: usize) -> Self
[src]
Set the maximum size of a field (in bytes)
The upload will error if a provided field is too large.
pub fn max_files(self, max: u32) -> Self
[src]
Set the maximum number of files allowed in the upload
THe upload will error if too many files are provided.
pub fn max_file_size(self, max: usize) -> Self
[src]
Set the maximum size for files (in bytes)
The upload will error if a provided file is too large.
pub fn field(self, name: &str, field: Field) -> Self
[src]
Trait Implementations
impl Clone for Form
[src]
fn clone(&self) -> Form
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Form
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,