pub struct JsonBody<U> { /* private fields */ }Expand description
Future that buffers and deserializes a JSON response body.
The future returns an error when:
- the content type is not JSON;
- the body exceeds the configured response payload limit; or
- reading or deserializing the body fails.
Implementations§
Source§impl<U> JsonBody<U>where
U: DeserializeOwned,
impl<U> JsonBody<U>where
U: DeserializeOwned,
Sourcepub fn new(res: &ClientResponse) -> Self
pub fn new(res: &ClientResponse) -> Self
Creates a JSON body future for res.
This takes the response payload. Creating another body future from the same response produces an empty body.
Trait Implementations§
Source§impl<U> Future for JsonBody<U>where
U: DeserializeOwned,
impl<U> Future for JsonBody<U>where
U: DeserializeOwned,
impl<U> Unpin for JsonBody<U>where
U: DeserializeOwned,
Auto Trait Implementations§
impl<U> !Freeze for JsonBody<U>
impl<U> !RefUnwindSafe for JsonBody<U>
impl<U> !Send for JsonBody<U>
impl<U> !Sync for JsonBody<U>
impl<U> !UnwindSafe for JsonBody<U>
impl<U> UnsafeUnpin for JsonBody<U>
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<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more