Struct actix_web::web::FormConfig
source · [−]pub struct FormConfig { /* private fields */ }
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
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