pub struct Response { /* private fields */ }
Expand description
A successful Response from the Ably REST API.
Implementations
sourceimpl Response
impl Response
pub fn new(response: Response) -> Self
sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
The HTTP status code of the response.
sourcepub fn content_type(&self) -> Option<Mime>
pub fn content_type(&self) -> Option<Mime>
The value of the Content-Type header.
sourcepub async fn body<T: DeserializeOwned>(self) -> Result<T>
pub async fn body<T: DeserializeOwned>(self) -> Result<T>
Deserialize the response body.
sourcepub async fn json<T: DeserializeOwned>(self) -> Result<T>
pub async fn json<T: DeserializeOwned>(self) -> Result<T>
Deserialize the response body as JSON.
sourcepub async fn msgpack<T: DeserializeOwned>(self) -> Result<T>
pub async fn msgpack<T: DeserializeOwned>(self) -> Result<T>
Deserialize the response body as MessagePack.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl !UnwindSafe for Response
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more