[−][src]Struct hreq_h1::SendStream
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]
&'_ mut self,
data: &'_ [u8],
end_of_body: bool
) -> Result<(), Error>
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]
&'_ mut self,
data: Vec<u8>,
end_of_body: bool
) -> Result<(), Error>
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
Auto Trait Implementations
impl !RefUnwindSafe for SendStream
impl Send for SendStream
impl Sync for SendStream
impl Unpin for SendStream
impl !UnwindSafe for SendStream
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,