Trait extrahop::ApiResponse [] [src]

pub trait ApiResponse: Sized {
    fn validate_status(self) -> Result<Response>;
fn deserialize<T: DeserializeOwned>(self) -> Result<T>; fn validate_and_read<T: DeserializeOwned>(self) -> Result<T> { ... } }

Validator and deserializer for REST API responses.

Required Methods

Checks if the status code returned was in the 2xx range. If so, returns the underlying response for further processing; otherwise returns an error.

Attempts to parse the response as JSON into T.

Provided Methods

Validates the status code and attempts to deserialize into T in one step.

Implementations on Foreign Types

impl ApiResponse for Response
[src]

impl ApiResponse for StdResult<Response, ReqwestError>
[src]

Implementors