pub struct Json<T>(pub T);Expand description
A JSON request body decoded into T.
Tuple Fields§
§0: TTrait Implementations§
impl<T: Eq> Eq for Json<T>
Source§impl<P, T> FromRequest<P> for Json<T>where
P: ?Sized,
T: DeserializeOwned + 'static,
impl<P, T> FromRequest<P> for Json<T>where
P: ?Sized,
T: DeserializeOwned + 'static,
Source§fn from_request<'a>(
_provider: &'a P,
_context: &'a mut InvocationContext,
request: &'a HandleRequest,
) -> ExtractorFuture<'a, Self>
fn from_request<'a>( _provider: &'a P, _context: &'a mut InvocationContext, request: &'a HandleRequest, ) -> ExtractorFuture<'a, Self>
Extracts this value or rejects dispatch before the handler runs.
Source§impl<T> IntoResponse for Json<T>where
T: Serialize,
impl<T> IntoResponse for Json<T>where
T: Serialize,
Source§fn into_response(self) -> Result<HandleResponse, ResponseBuildError>
fn into_response(self) -> Result<HandleResponse, ResponseBuildError>
Builds the response or preserves a serialization/header failure.
impl<T: PartialEq> StructuralPartialEq for Json<T>
Auto Trait Implementations§
impl<T> Freeze for Json<T>where
T: Freeze,
impl<T> RefUnwindSafe for Json<T>where
T: RefUnwindSafe,
impl<T> Send for Json<T>where
T: Send,
impl<T> Sync for Json<T>where
T: Sync,
impl<T> Unpin for Json<T>where
T: Unpin,
impl<T> UnsafeUnpin for Json<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Json<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.