pub struct RawResponse { /* private fields */ }Expand description
A Server response, unchanged, for any HTTP status.
Implementations§
Source§impl RawResponse
impl RawResponse
pub fn status(&self) -> u16
pub fn is_success(&self) -> bool
Sourcepub fn header(&self, name: &str) -> Option<&str>
pub fn header(&self, name: &str) -> Option<&str>
A response header value, when present and valid visible ASCII.
Sourcepub fn headers(&self) -> impl Iterator<Item = (&str, &[u8])>
pub fn headers(&self) -> impl Iterator<Item = (&str, &[u8])>
Every response header as received. Names are lowercase.
Sourcepub fn protocol_version(&self) -> Option<&str>
pub fn protocol_version(&self) -> Option<&str>
The worker protocol version the Server echoed, if any.
Sourcepub fn control_plane_version(&self) -> Option<&str>
pub fn control_plane_version(&self) -> Option<&str>
The control-plane version the Server echoed, if any.
Sourcepub fn body_bytes(&self) -> &[u8] ⓘ
pub fn body_bytes(&self) -> &[u8] ⓘ
The exact response body bytes.
Sourcepub fn refusal(&self) -> Option<HttpRefusal>
pub fn refusal(&self) -> Option<HttpRefusal>
The decoded refusal body of a non-2xx response whose body is a JSON
object. None for 2xx responses and other bodies.
Sourcepub fn error_for_status(self) -> Result<Self>
pub fn error_for_status(self) -> Result<Self>
Return the response for 2xx. Otherwise return the error a typed call
would: Error::Protocol for a protocol-version refusal, else
Error::Http with the exact body text.
Trait Implementations§
Source§impl Clone for RawResponse
impl Clone for RawResponse
Source§fn clone(&self) -> RawResponse
fn clone(&self) -> RawResponse
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RawResponse
impl RefUnwindSafe for RawResponse
impl Send for RawResponse
impl Sync for RawResponse
impl Unpin for RawResponse
impl UnwindSafe for RawResponse
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