pub struct Validated<T>(pub T);Expand description
The extractor that runs a FormRequest.
ⓘ
async fn store(Validated(post): Validated<StorePost>) -> Response {
Response::text(post.title) // authorised, validated, filtered
}Tuple Fields§
§0: TImplementations§
Source§impl<T> Validated<T>
impl<T> Validated<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Unwrap the payload.
Trait Implementations§
impl<T: Copy> Copy for Validated<T>
Source§impl<T: FormRequest> FromRequest for Validated<T>
impl<T: FormRequest> FromRequest for Validated<T>
Source§fn from_request(request: Arc<Request>) -> BoxedFuture<Result<Self>>
fn from_request(request: Arc<Request>) -> BoxedFuture<Result<Self>>
Build
Self from the request, or fail with the error the client should
see (a 400 for a malformed body, a 422 for a failed contract).Auto Trait Implementations§
impl<T> Freeze for Validated<T>where
T: Freeze,
impl<T> RefUnwindSafe for Validated<T>where
T: RefUnwindSafe,
impl<T> Send for Validated<T>where
T: Send,
impl<T> Sync for Validated<T>where
T: Sync,
impl<T> Unpin for Validated<T>where
T: Unpin,
impl<T> UnsafeUnpin for Validated<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Validated<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