pub struct Form<T>(pub T);Expand description
A wrapper type for URL-encoded form data deserialization.
This type can be used standalone for convenient form parsing,
and when the axum feature is enabled, it implements Axum’s
FromRequest trait for extracting form data from request bodies.
§Example
use facet::Facet;
use facet_urlencoded::Form;
#[derive(Debug, Facet)]
struct LoginForm {
username: String,
password: String,
}
// Wrap a value
let form = Form(LoginForm {
username: "alice".to_string(),
password: "secret".to_string(),
});
// Access the inner value
println!("Username: {}", form.username);Tuple Fields§
§0: TImplementations§
Source§impl<T> Form<T>
impl<T> Form<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume the wrapper and return the inner value.
Trait Implementations§
Source§impl<T: Ord> Ord for Form<T>
impl<T: Ord> Ord for Form<T>
Source§impl<T: PartialOrd> PartialOrd for Form<T>
impl<T: PartialOrd> PartialOrd for Form<T>
impl<T: Copy> Copy for Form<T>
impl<T: Eq> Eq for Form<T>
impl<T> StructuralPartialEq for Form<T>
Auto Trait Implementations§
impl<T> Freeze for Form<T>where
T: Freeze,
impl<T> RefUnwindSafe for Form<T>where
T: RefUnwindSafe,
impl<T> Send for Form<T>where
T: Send,
impl<T> Sync for Form<T>where
T: Sync,
impl<T> Unpin for Form<T>where
T: Unpin,
impl<T> UnwindSafe for Form<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