Expand description
§Description
This crate contains the trait MultipartWrite, assorted implementations,
and combinators.
A MultipartWrite is a similar interface to Sink, except that writing
an item or completing the write both return values.
Here is a conceptual example of a MultipartWrite.
§Motivation
Sink is a useful API, but it is just that: a sink, the end of a stream.
It’s valuable to have the backpressure mechanism that poll_ready combined
with start_send enables, and it’s nice to have the flexibility that the
shape of Sink provides in what kinds of values you can send with it.
The idea for MultipartWrite is to:
- Have those same desirable properies: backpressure and generic input type.
- Be able to be inserted earlier in a stream computation.
- Replace
Sinkwhen the use case would need a value returned by sending to it or closing it. - Transform a stream by writing it in parts, which is somewhat of a specific rephrasing of the second and third points.
Modules§
Traits§
- Fused
Multipart Write - A writer that tracks whether or not the underlying writer should no longer be polled.
- Multipart
Stream Ext - An extension trait for
Streams that provides combinators to use withMultipartWriters. - Multipart
Write MultipartWriteis aSink-like interface for asynchronously writing an object in parts.- Multipart
Write Ext - An extension trait for
MultipartWriteproviding a variety of convenient combinator functions.
Type Aliases§
- BoxMultipart
Write - An owned, dynamically typed
MultipartWritefor use in cases where it is not possible or desirable to statically type it. - Local
BoxMultipart Write BoxMultipartWritebut without theSendrequirement.