pub struct BoundedResponse {
pub status: StatusCode,
pub headers: HeaderMap,
pub body: String,
}Expand description
A fully buffered response with status and headers.
Fields§
§status: StatusCodeHTTP status code.
headers: HeaderMapResponse headers.
body: StringUTF-8 response body.
Implementations§
Source§impl BoundedResponse
impl BoundedResponse
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Returns true for 2xx statuses.
Sourcepub fn error_for_status(self) -> Result<Self, HttpError>
pub fn error_for_status(self) -> Result<Self, HttpError>
Converts a non-2xx response into HttpError::Status.
Trait Implementations§
Source§impl Clone for BoundedResponse
impl Clone for BoundedResponse
Auto Trait Implementations§
impl Freeze for BoundedResponse
impl RefUnwindSafe for BoundedResponse
impl Send for BoundedResponse
impl Sync for BoundedResponse
impl Unpin for BoundedResponse
impl UnsafeUnpin for BoundedResponse
impl UnwindSafe for BoundedResponse
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