Struct actix_form_data::Form [−][src]
pub struct Form<T, E> { /* fields omitted */ }
Expand description
A structure that defines the fields expected in form data
Example
let form = Form::<(), Error>::new()
.field("field-name", Field::text())
.field("second-field", Field::int())
.field("third-field", Field::float())
.field("fifth-field", Field::file(|_, _, _| async move {
Ok(())
}))
.field(
"map-field",
Field::map()
.field("sub-field", Field::text())
.field("sub-field-two", Field::text())
.finalize()
)
.field(
"array-field",
Field::array(Field::text())
);
Implementations
Create a new form
If you wish to provide your own executor, use the with_executor
method.
Default values are as follows
- max_fields: 100
- max_field_size: 10_000 bytes
- max_files: 20
- max_files_size: 10_000_000 bytes
Set the Transform Error method to convert Error types into actix_web::Error by hand
Set the maximum number of fields allowed in the upload
The upload will error if too many fields are provided.
Set the maximum size of a field (in bytes)
The upload will error if a provided field is too large.
Set the maximum number of files allowed in the upload
THe upload will error if too many files are provided.
Set the maximum size for files (in bytes)
The upload will error if a provided file is too large.
Trait Implementations
impl<S, T, E> Transform<S, ServiceRequest> for Form<T, E> where
S: Service<ServiceRequest, Error = Error>,
S::Future: 'static,
T: 'static,
E: ResponseError + 'static,
impl<S, T, E> Transform<S, ServiceRequest> for Form<T, E> where
S: Service<ServiceRequest, Error = Error>,
S::Future: 'static,
T: 'static,
E: ResponseError + 'static,
Auto Trait Implementations
impl<T, E> !RefUnwindSafe for Form<T, E>
impl<T, E> !UnwindSafe for Form<T, E>
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more