Struct hyper::body::Sender[][src]

pub struct Sender { /* fields omitted */ }
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

Check to see if this Sender can send more data.

Send data on data channel when it is ready.

Send trailers on trailers channel.

Try to send data on this channel.

Errors

Returns Err(Bytes) if the channel could not (currently) accept another Bytes.

Note

This is mostly useful for when trying to send from some other thread that doesn’t have an async context. If in an async context, prefer send_data() instead.

Aborts the body in an abnormal fashion.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more