Trait elastic_responses::parsing::ResponseBody
[−]
[src]
pub trait ResponseBody where
Self: Sized, { type Buffered: ResponseBody; fn body(self) -> Result<(Value, Self::Buffered), ParseResponseError>; fn parse_ok<T: DeserializeOwned>(self) -> Result<T, ParseResponseError>; fn parse_err(self) -> Result<ApiError, ParseResponseError>; }
A http response body that can be buffered into a json value.
Associated Types
type Buffered: ResponseBody
The type of a buffered response body.
Required Methods
fn body(self) -> Result<(Value, Self::Buffered), ParseResponseError>
Buffer the response body to a json value and return a new buffered representation.
fn parse_ok<T: DeserializeOwned>(self) -> Result<T, ParseResponseError>
Parse the body as a success result.
fn parse_err(self) -> Result<ApiError, ParseResponseError>
Parse the body as an API error.