Expand description
Crate extending functionality of futures crate
Re-exports§
pub use futures as futures_reexport;
Modules§
- decode
- A layered
Decoderadapter forStreamtransformations - encode
- A layered
Encoderadapter forStreamtransformations - io
- Extends the functionality of std::io and ::tokio_io
Macros§
- ensure_
boxfuture - Macro that can be used like ensure! macro from failure crate, but in the context where the expected return type is BoxFuture. Exits a function early with an Error if the condition is not satisfied.
- ensure_
boxstream - Macro that can be used like ensure! macro from failure crate, but in the context where the expected return type is BoxStream. Exits a function early with an Error if the condition is not satisfied.
- handle_
nb - A convenience macro for working with
io::Result<T>from theReadandWritetraits. - try_
boxfuture - Macro that can be used like
?operator, but in the context where the expected return type is BoxFuture. The result of it is either Ok part of Result or immediate returning the Err part converted into BoxFuture. - try_
boxstream - Macro that can be used like
?operator, but in the context where the expected return type is BoxStream. The result of it is either Ok part of Result or immediate returning the Err part converted into BoxStream. - try_
left_ future - Macro that can be used like
?operator, but in the context where the expected return type is a left future. The result of it is either Ok part of Result or immediate returning the Err
Structs§
- Batch
Stream - It’s a combinator that converts
Stream<A>intoStream<Vec<A>>. So interface is similar to.chunks()method, but there’s an important difference: BatchStream won’t wait until the whole batch fills up i.e. as soon as underlying stream return NotReady, then new batch is returned from BatchStream - Buffered
Params - Params for StreamExt::buffered_weight_limited and WeightLimitedBufferedStream
- Bytes
Stream - A structure that wraps a Stream of Bytes and lets it being accessed both as a Stream and as AsyncRead. It is very useful when decoding Stream of Bytes in an asynchronous way.
- Bytes
Stream Future - A future that yields a single decoded item from the Bytes of the provided BytesStream (if any) and the remaining BytesStream.
- Collect
NoConsume - A future which collects all of the values of a stream into a vector.
- Collect
To - Stream returned as a result of calling crate::StreamExt::collect_to
- Conservative
Receiver - This is a wrapper around oneshot::Receiver that will return error when the receiver was polled and the result was not ready. This is a very strict way of preventing deadlocks in code when receiver is polled before the sender has send the result
- Discard
- Map
ItemandErrorto() - Enumerate
- Like std::iter::Enumerate, but for Stream
- Futures
Ordered - A future which takes a list of futures, executes them serially, and resolves with a vector of the completed values.
- Inspect
Err - Do something with an error if the future failed.
- Inspect
Result - Inspect the Result returned by a future
- Return
Remainder - A stream wrapper returned by StreamExt::return_remainder
- Select
All - An unbounded set of streams
- Sink
ToAsync Write - Simple adapter from
Sinkinterface toAsyncWriteinterface. It can be useful to convert from the interface that supports only AsyncWrite, and get Stream as a result. - Weight
Limited Buffered Stream - Like stream::Buffered, but can also limit number of futures in a buffer by “weight”.
Enums§
- Conservative
Receiver Error - Error that can be returned by ConservativeReceiver
- Stream
Either - Like future::Either, but for Stream
Traits§
- Future
Ext - A trait implemented by default for all Futures which extends the standard functionality.
- Stream
Ext - A trait implemented by default for all Streams which extends the standard functionality.
- Stream
Layered Ext - Trait that provides a function for making a decoding layer on top of Stream of Bytes
Functions§
- futures_
ordered - Creates a stream which returns results of the futures given.
- select_
all - Convert a list of streams into a
Streamof results from the streams. - send_
discard - Send an item over an mpsc channel, discarding both the sender and receiver-closed errors. This should be used when the receiver being closed makes sending values moot, since no one is interested in the results any more.
- split_
err - Given an input stream, split its error out to a separate Future, and returning that error Future and an infallable Stream. There are two outcomes:
Type Aliases§
- BoxFuture
- Replacement for BoxFuture, deprecated in upstream futures-rs.
- BoxFuture
NonSend - Replacement for BoxFutureNonSend, deprecated in upstream futures-rs.
- BoxStream
- Replacement for BoxStream, deprecated in upstream futures-rs.
- BoxStream
NonSend - Replacement for BoxStreamNonSend, deprecated in upstream futures-rs.