pub struct HttpResponse {
pub status_code: u16,
pub headers: HashMap<String, String>,
pub body: Option<Value>,
pub response_time_ms: u64,
pub is_success: bool,
}Expand description
HTTP response from REST API calls.
Fields§
§status_code: u16HTTP status code.
headers: HashMap<String, String>Response headers.
body: Option<Value>Response body.
response_time_ms: u64Response time in milliseconds.
is_success: boolWhether the request was successful (2xx status).
Implementations§
Source§impl HttpResponse
impl HttpResponse
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if response indicates success.
Sourcepub fn is_client_error(&self) -> bool
pub fn is_client_error(&self) -> bool
Check if response indicates client error.
Sourcepub fn is_server_error(&self) -> bool
pub fn is_server_error(&self) -> bool
Check if response indicates server error.
Trait Implementations§
Source§impl Clone for HttpResponse
impl Clone for HttpResponse
Source§fn clone(&self) -> HttpResponse
fn clone(&self) -> HttpResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpResponse
impl Debug for HttpResponse
Source§impl<'de> Deserialize<'de> for HttpResponse
impl<'de> Deserialize<'de> for HttpResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HttpResponse
impl RefUnwindSafe for HttpResponse
impl Send for HttpResponse
impl Sync for HttpResponse
impl Unpin for HttpResponse
impl UnsafeUnpin for HttpResponse
impl UnwindSafe for HttpResponse
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