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

pub struct FormConfig { /* fields omitted */ }

Form extractor configuration

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

#[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)
             .with(index)
             .limit(4096);} // <- change form extractor configuration
    );
}

Methods

impl FormConfig
[src]

Important traits for &'a mut W
[src]

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

Trait Implementations

impl Default for FormConfig
[src]

[src]

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

Auto Trait Implementations

impl Send for FormConfig

impl Sync for FormConfig