Struct actix_web::web::FormConfig [−][src]
pub struct FormConfig { /* fields omitted */ }
Expand description
Form
extractor configuration.
use actix_web::{post, web, App, FromRequest, Result}; use serde::Deserialize; #[derive(Deserialize)] struct Info { username: String, } // Custom `FormConfig` is applied to App. // Max payload size for URL encoded forms is set to 4kB. #[post("/")] async fn index(form: web::Form<Info>) -> Result<String> { Ok(format!("Welcome {}!", form.username)) } App::new() .app_data(web::FormConfig::default().limit(4096)) .service(index);
Implementations
Set maximum accepted payload size. By default this limit is 16kB.
pub fn error_handler<F>(self, f: F) -> Self where
F: Fn(UrlencodedError, &HttpRequest) -> Error + 'static,
pub fn error_handler<F>(self, f: F) -> Self where
F: Fn(UrlencodedError, &HttpRequest) -> Error + 'static,
Set custom error handler
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for FormConfig
impl !Send for FormConfig
impl !Sync for FormConfig
impl Unpin for FormConfig
impl !UnwindSafe for FormConfig
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V