pub struct Json<T>(/* private fields */);Expand description
Represents request body or response.
If it is in a parameter, content-type should be application/json and
request body will be deserialized.
If it is in a return type, response will contain a content type header with
value application/json, and value is serialized.
Implementations§
Source§impl<T> Json<T>
impl<T> Json<T>
pub fn into_inner(self) -> T
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Json<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Json<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> FromRequest for Json<T>where
T: 'static + Send + DeserializeOwned,
impl<T> FromRequest for Json<T>where
T: 'static + Send + DeserializeOwned,
Source§impl<T: Ord> Ord for Json<T>
impl<T: Ord> Ord for Json<T>
Source§impl<T: PartialOrd> PartialOrd for Json<T>
impl<T: PartialOrd> PartialOrd for Json<T>
Source§impl<T> Reply for Json<T>
impl<T> Reply for Json<T>
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Converts the given value into a
Response.Source§impl<T> ResponseEntity for Json<T>where
T: Entity,
impl<T> ResponseEntity for Json<T>where
T: Entity,
fn describe_responses(comp_d: &mut ComponentDescriptor) -> Responses
impl<T: Copy> Copy for Json<T>
impl<T: Eq> Eq for Json<T>
impl<T> 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> 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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.