[−][src]Crate futures_ext
Crate extending functionality of futures
crate
Re-exports
pub use futures as futures_reexport; |
Modules
bounded_traversal | Read the documentation of bounded_traversal, bounded_traversal_dag and bounded_traversal_stream |
decode | A layered |
encode | A layered |
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 |
try_boxfuture | Macro that can be used like |
try_boxstream | Macro that can be used like |
try_left_future | Macro that can be used like |
Structs
BatchStream | It's a combinator that converts |
BufferedParams | Params for StreamExt::buffered_weight_limited and WeightLimitedBufferedStream |
BytesStream | 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. |
BytesStreamFuture | A future that yields a single decoded item from the Bytes of the provided BytesStream (if any) and the remaining BytesStream. |
CollectNoConsume | A future which collects all of the values of a stream into a vector. |
CollectTo | Stream returned as a result of calling crate::StreamExt::collect_to |
ConservativeReceiver | 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 |
Enumerate | Like std::iter::Enumerate, but for Stream |
FuturesOrdered | A future which takes a list of futures, executes them serially, and resolves with a vector of the completed values. |
InspectErr | Do something with an error if the future failed. |
InspectResult | Inspect the Result returned by a future |
ReturnRemainder | A stream wrapper returned by StreamExt::return_remainder |
SelectAll | An unbounded set of streams |
SinkToAsyncWrite | Simple adapter from |
StreamWithTimeout | A stream wrapper returned by StreamExt::whole_stream_timeout |
WeightLimitedBufferedStream | Like stream::Buffered, but can also limit number of futures in a buffer by "weight". |
Enums
ConservativeReceiverError | Error that can be returned by ConservativeReceiver |
StreamEither | Like future::Either, but for Stream |
StreamTimeoutError | Error returned by StreamWithTimeout |
Traits
FutureExt | A trait implemented by default for all Futures which extends the standard functionality. |
StreamExt | A trait implemented by default for all Streams which extends the standard functionality. |
StreamLayeredExt | Trait that provides a function for making a decoding layer on top of Stream of Bytes |
Functions
asynchronize | This method allows us to take synchronous code, schedule it on the default tokio thread pool
and convert it to the future. It's the combination of |
closure_to_blocking_future | Given an |
futures_ordered | Creates a stream which returns results of the futures given. |
select_all | Convert a list of streams into a |
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. |
spawn_future | Take a future, and run it on its own task, returning the result to the caller. This permits Rust to run the spawned future on a different thread to the task that spawned it, thus adding parallelism if used sensibly. Note that the spawning here is lazy - the new task will not be spawned if the returned future is dropped before it's polled. |
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: |
stream_clone | Given an input Stream, return clones of that stream. This requires both the item and the error to be cloneable. This provides a single element of buffering - all clones must consume each element before the original can make progress. |
top_level_launch | Starts the Tokio runtime using the supplied future to bootstrap the execution. |
Type Definitions
BoxFuture | Replacement for BoxFuture, deprecated in upstream futures-rs. |
BoxFutureNonSend | Replacement for BoxFutureNonSend, deprecated in upstream futures-rs. |
BoxStream | Replacement for BoxStream, deprecated in upstream futures-rs. |
BoxStreamNonSend | Replacement for BoxStreamNonSend, deprecated in upstream futures-rs. |