Trait elastic::client::responses::parse::ResponseBody
[−]
pub trait ResponseBody { type Buffered: ResponseBody; fn body(self) -> Result<(Value, Self::Buffered), ParseResponseError>; fn parse_ok<T>(self) -> Result<T, ParseResponseError>
where
T: DeserializeOwned; 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>(self) -> Result<T, ParseResponseError> where
T: DeserializeOwned,
T: DeserializeOwned,
Parse the body as a success result.
fn parse_err(self) -> Result<ApiError, ParseResponseError>
Parse the body as an API error.