Struct elastic::client::responses::parse::MaybeOkResponse
[−]
pub struct MaybeOkResponse<B> where
B: ResponseBody, { /* fields omitted */ }
A response that might be successful or an ApiError
.
Methods
impl<B> MaybeOkResponse<B> where
B: ResponseBody,
B: ResponseBody,
fn new<I>(ok: bool, res: I) -> MaybeOkResponse<B> where
I: Into<MaybeBufferedResponse<B>>,
I: Into<MaybeBufferedResponse<B>>,
Create a new response that indicates where or not the
body is successful or an ApiError
.
fn ok<I>(res: I) -> MaybeOkResponse<B> where
I: Into<MaybeBufferedResponse<B>>,
I: Into<MaybeBufferedResponse<B>>,
Create a response where the body is successful.
fn err<I>(res: I) -> MaybeOkResponse<B> where
I: Into<MaybeBufferedResponse<B>>,
I: Into<MaybeBufferedResponse<B>>,
Create a resposne where the body is an error.