pub struct HttpResponse { /* private fields */ }Expand description
HTTP response abstraction.
Minimal wrapper around an HTTP response, exposing only what adapters need. No reqwest types are exposed in the public API.
Implementations§
Source§impl HttpResponse
impl HttpResponse
Sourcepub fn new(status: u16, body_stream: ByteStream) -> Self
pub fn new(status: u16, body_stream: ByteStream) -> Self
Create from parts (used by ReqwestHttpClient).
Sourcepub fn from_text(status: u16, body_text: String) -> Self
pub fn from_text(status: u16, body_text: String) -> Self
Create from a pre-read text body (for error responses).
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Whether the response is a success (2xx).
Sourcepub fn bytes_stream(self) -> ByteStream
pub fn bytes_stream(self) -> ByteStream
Get a byte stream for SSE parsing.
Auto Trait Implementations§
impl !RefUnwindSafe for HttpResponse
impl !Sync for HttpResponse
impl !UnwindSafe for HttpResponse
impl Freeze for HttpResponse
impl Send for HttpResponse
impl Unpin for HttpResponse
impl UnsafeUnpin 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