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
Auto Trait Implementations§
impl Forget for RawResponse
impl Freeze for RawResponsewhere
*const [Pos] is !null: Freeze,
PhantomData<[Pos]>: Freeze,
*const u8 is !null: Freeze,
PhantomData<Bucket<HeaderValue>>: Freeze,
PhantomData<ExtraValue<HeaderValue>>: Freeze,
PhantomData<u8>: Freeze,
impl Move for RawResponse
impl RefUnwindSafe for RawResponse
impl Send for RawResponse
impl Sync for RawResponse
impl Unpin for RawResponse
impl UnsafeUnpin for RawResponsewhere
*const [Pos] is !null: UnsafeUnpin,
PhantomData<[Pos]>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Bucket<HeaderValue>>: UnsafeUnpin,
PhantomData<ExtraValue<HeaderValue>>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for RawResponsewhere
BoxRaw<[Pos]>: UnwindSafe,
RawVecInner: UnwindSafe,
*const u8: UnwindSafe,
Align8<*mut ()>: UnwindSafe,
&'static Vtable: UnwindSafe,
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