Struct actix_xml::XmlConfig [−][src]
pub struct XmlConfig { /* fields omitted */ }Expand description
XML extractor configuration
Example
use actix_web::{error, web, App, FromRequest, HttpResponse}; use actix_xml::{Xml, XmlConfig}; use serde::Deserialize; #[derive(Deserialize)] struct Info { username: String, } /// deserialize `Info` from request's body, max payload size is 4kb async fn index(info: Xml<Info>) -> String { format!("Welcome {}!", info.username) } fn main() { let app = App::new().service( web::resource("/index.html") .app_data( // Json extractor configuration for this resource. XmlConfig::default() .limit(4096) // Limit request payload size .content_type(|mime| { // <- accept text/plain content type mime.type_() == mime::TEXT && mime.subtype() == mime::PLAIN }) ) .route(web::post().to(index)) ); }
Implementations
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for XmlConfigimpl !UnwindSafe for XmlConfigBlanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = TShould always be Self
pub fn vzip(self) -> V