pub struct ResponseExt<B = Bytes> {
pub response_parts: Parts,
pub body: B,
}Expand description
Response (Extended)
Fields§
§response_parts: PartsHTTP response parts (see http::response::Parts)
body: BBody bytes
Implementations§
Source§impl ResponseExt
impl ResponseExt
Sourcepub fn json<T>(self) -> Result<ResponseExt<T>, Self>where
T: for<'a> Deserialize<'a>,
pub fn json<T>(self) -> Result<ResponseExt<T>, Self>where
T: for<'a> Deserialize<'a>,
Convert the body to a JSON value
If the body is not valid JSON, the original response is returned as an error.
Trait Implementations§
Source§impl<B: Clone> Clone for ResponseExt<B>
impl<B: Clone> Clone for ResponseExt<B>
Source§fn clone(&self) -> ResponseExt<B>
fn clone(&self) -> ResponseExt<B>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<B> Freeze for ResponseExt<B>where
B: Freeze,
impl<B = Bytes> !RefUnwindSafe for ResponseExt<B>
impl<B> Send for ResponseExt<B>where
B: Send,
impl<B> Sync for ResponseExt<B>where
B: Sync,
impl<B> Unpin for ResponseExt<B>where
B: Unpin,
impl<B = Bytes> !UnwindSafe for ResponseExt<B>
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