# actix_web::dev::FormConfig - Rust
API documentation for the Rust `FormConfig` struct in crate `actix_web`.
Keywords: rust, rustlang, rust-lang, FormConfig

# Struct actix_web::dev::FormConfig [−] [src]

    pub struct FormConfig<S> { /* fields omitted */ }

Form extractor configuration

    #[macro_use] extern crate serde_derive;
    use actix_web::{http, App, Form, Result};

    #[derive(Deserialize)]
    struct FormData {
        username: String,
    }

    /// extract form data using serde.
    /// custom configuration is used for this handler, max payload size is 4k
    fn index(form: Form<FormData>) -> Result<String> {
        Ok(format!("Welcome {}!", form.username))
    }

    fn main() {
        let app = App::new().resource(
            "/index.html",
            |r| {
                r.method(http::Method::GET)
                    // register form handler and change form extractor configuration
                    .with_config(index, |cfg| {cfg.limit(4096);})
            },
        );
    }

## Methods

###

`impl<S> FormConfig<S>`

[src]

####
ⓘImportant traits for &'a mut R

### Important traits for &'a mut R

`impl<'a, R> Read for &'a mut R where
R: Read + ?Sized, impl<'a, W> Write for &'a mut W where
W: Write + ?Sized, impl<'a, I> Iterator for &'a mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;`

`pub fn limit(&mut self, limit: usize) -> &mut Self`

[src]

Change max size of payload. By default max size is 256Kb

####
ⓘImportant traits for &'a mut R

### Important traits for &'a mut R

`impl<'a, R> Read for &'a mut R where
R: Read + ?Sized, impl<'a, W> Write for &'a mut W where
W: Write + ?Sized, impl<'a, I> Iterator for &'a mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;`

`pub fn error_handler<F>(&mut self, f: F) -> &mut Self where F: Fn(UrlencodedError, &HttpRequest<S>) -> Error + 'static,`

[src]

Set custom error handler

## Trait Implementations

###

`impl<S> Default for FormConfig<S>`

[src]

####

`fn default() -> Self`

[src]

Returns the "default value" for a type. Read more

## Auto Trait Implementations

###

`impl<S> !Send for FormConfig<S>`

###

`impl<S> !Sync for FormConfig<S>`

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)