Skip to main content

Response

Struct Response 

Source
pub struct Response<'b, 'h> {
    pub version: Version,
    pub status: u16,
    pub reason: &'b [u8],
    pub headers: &'h [Header<'b>],
    pub framing: Framing,
    pub keep_alive: bool,
    pub upgraded: bool,
    pub head_len: usize,
}
Expand description

A parsed response head.

Fields§

§version: Version

The version.

§status: u16

The status code, 100 to 599.

§reason: &'b [u8]

The reason phrase (possibly empty).

§headers: &'h [Header<'b>]

All header fields in order.

§framing: Framing

How the body is delimited, given the request method.

§keep_alive: bool

Whether the connection may be reused.

§upgraded: bool

The connection now carries another protocol: 101 Switching Protocols, or a 2xx reply to CONNECT (a tunnel).

§head_len: usize

Bytes taken by the head.

Implementations§

Source§

impl<'b> Response<'b, '_>

Source

pub fn header(&self, name: &[u8]) -> Option<&'b [u8]>

The value of the first header named name (case-insensitive).

Trait Implementations§

Source§

impl<'b, 'h> Clone for Response<'b, 'h>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'b, 'h> Copy for Response<'b, 'h>

Source§

impl<'b, 'h> Debug for Response<'b, 'h>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'b, 'h> Eq for Response<'b, 'h>

Source§

impl<'b, 'h> PartialEq for Response<'b, 'h>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'b, 'h> StructuralPartialEq for Response<'b, 'h>

Auto Trait Implementations§

§

impl<'b, 'h> Forget for Response<'b, 'h>

§

impl<'b, 'h> Freeze for Response<'b, 'h>

§

impl<'b, 'h> Move for Response<'b, 'h>

§

impl<'b, 'h> RefUnwindSafe for Response<'b, 'h>

§

impl<'b, 'h> Send for Response<'b, 'h>

§

impl<'b, 'h> Sync for Response<'b, 'h>

§

impl<'b, 'h> Unpin for Response<'b, 'h>

§

impl<'b, 'h> UnsafeUnpin for Response<'b, 'h>

§

impl<'b, 'h> UnwindSafe for Response<'b, 'h>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.