pub struct Sender { /* private fields */ }
Expand description
A sender half created through Body::channel()
.
Useful when wanting to stream chunks from another thread.
Body Closing
Note that the request body will always be closed normally when the sender is dropped (meaning
that the empty terminating chunk will be sent to the remote). If you desire to close the
connection with an incomplete response (e.g. in the case of an error during asynchronous
processing), call the Sender::abort()
method to abort the body in an abnormal fashion.
Implementations
sourceimpl Sender
impl Sender
sourcepub fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>
pub fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>
Check to see if this Sender
can send more data.
sourcepub async fn send_data(&mut self, chunk: Bytes) -> Result<()>
pub async fn send_data(&mut self, chunk: Bytes) -> Result<()>
Send data on data channel when it is ready.
sourcepub async fn send_trailers(&mut self, trailers: HeaderMap) -> Result<()>
pub async fn send_trailers(&mut self, trailers: HeaderMap) -> Result<()>
Send trailers on trailers channel.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Sender
impl Send for Sender
impl Sync for Sender
impl Unpin for Sender
impl !UnwindSafe for Sender
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more