pub struct HttpOutput { /* private fields */ }Expand description
Output of a completed HTTP request.
Contains the status code, response headers, body, and duration.
Implementations§
Source§impl HttpOutput
impl HttpOutput
Sourcepub fn json<T: DeserializeOwned>(&self) -> Result<T, OperationError>
pub fn json<T: DeserializeOwned>(&self) -> Result<T, OperationError>
Deserialize the response body as JSON into the given type T.
§Errors
Returns OperationError::Deserialize if parsing fails.
Sourcepub fn duration_ms(&self) -> u64
pub fn duration_ms(&self) -> u64
Return the wall-clock duration of the request in milliseconds.
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Return true if the status code is in the 2xx range.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HttpOutput
impl RefUnwindSafe for HttpOutput
impl Send for HttpOutput
impl Sync for HttpOutput
impl Unpin for HttpOutput
impl UnsafeUnpin for HttpOutput
impl UnwindSafe for HttpOutput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more