Skip to main content

Streaming

Struct Streaming 

Source
pub struct Streaming { /* private fields */ }
Expand description

A response head with its unread body.

Implementations§

Source§

impl Streaming

Source

pub fn status(&self) -> u16

The status code.

Source

pub fn headers(&self) -> &[(String, String)]

The headers, in arrival order.

Source

pub fn header(&self, name: &str) -> Option<&str>

The first header with this name, ASCII case-insensitive.

Source

pub fn url(&self) -> &str

The URL that answered, after redirects.

Source

pub fn expected_length(&self) -> Option<u64>

Content-Length, when the response declared one.

Source

pub fn head(&self) -> &Head

The whole head.

Source

pub fn into_body(self) -> Body

The body, unread.

Source

pub fn into_parts(self) -> (Head, Body)

The head and the body, apart.

Source

pub fn collect_async( self, on_done: impl FnOnce(Result<Response, HttpError>) + Send + 'static, )

Read the whole body into memory; on_done receives the response.

Source

pub fn collect_future(self) -> Collecting ⓘ

Read the whole body into memory and await the response.

Trait Implementations§

Source§

impl Debug for Streaming

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> 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> Same for T

Source§

type Output = T

Should always be Self
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.