pub struct Xml<T>(pub T);Expand description
Xml extractor
Xml can be used to extract typed information from request’s body.
XmlConfig allows to configure extraction process.
§Example
use actix_web::{web, App};
use actix_xml::Xml;
use serde::Deserialize;
#[derive(Deserialize)]
struct Info {
username: String,
}
/// deserialize `Info` from request's body
async fn index(info: Xml<Info>) -> String {
format!("Welcome {}!", info.username)
}
fn main() {
let app = App::new().service(
web::resource("/index.html").route(
web::post().to(index))
);
}Tuple Fields§
§0: TImplementations§
Source§impl<T> Xml<T>
impl<T> Xml<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Deconstruct to an inner value
Trait Implementations§
Source§impl<T> FromRequest for Xml<T>where
T: DeserializeOwned + 'static,
impl<T> FromRequest for Xml<T>where
T: DeserializeOwned + 'static,
Auto Trait Implementations§
impl<T> Freeze for Xml<T>where
T: Freeze,
impl<T> RefUnwindSafe for Xml<T>where
T: RefUnwindSafe,
impl<T> Send for Xml<T>where
T: Send,
impl<T> Sync for Xml<T>where
T: Sync,
impl<T> Unpin for Xml<T>where
T: Unpin,
impl<T> UnsafeUnpin for Xml<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Xml<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more