[][src]Struct hreq_h1::SendStream

pub struct SendStream { /* fields omitted */ }

Send some body data to a remote peer.

Obtained either via a client::SendRequest or a server::SendResponse.

Implementations

impl SendStream[src]

pub async fn send_data<'_, '_>(
    &'_ mut self,
    data: &'_ [u8],
    end_of_body: bool
) -> Result<(), Error>
[src]

Send one chunk of data. Use end_of_body to signal end of data.

When the body is constrained by a content-length header, this will only accept the amount of bytes specified in the header. If there is too much data, the function will error with a Error::User.

For transfer-encoding: chunked, call to this function corresponds to one "chunk".

pub async fn send_data_owned<'_>(
    &'_ mut self,
    data: Vec<u8>,
    end_of_body: bool
) -> Result<(), Error>
[src]

Send one chunk of data. Use end_of_body to signal end of data.

This is an optimization which together with a content-length shortcuts some unnecessary copying of data.

When the body is constrained by a content-length header, this will only accept the amount of bytes specified in the header. If there is too much data, the function will error with a Error::User.

For transfer-encoding: chunked, call to this function corresponds to one "chunk".

Trait Implementations

impl Debug for SendStream[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.