Crate future_utils [] [src]

Modules

mpsc

channels in the futures-rs crate cannot error, yet they return () for their error type for some stupid reason. This is a wrapper around futures-rs unbounded channels which removes the error.

Structs

DropNotice

Created in tandem with a DropNotifier using the drop_notify function. DropNotice is a future which resolves to () when its corresponding DropNotify is dropped.

DropNotify

Created in tandem with a DropNotice using the drop_notify function. Drop this object to cause its corresponding DropNotice to resolve.

Finally

Wraps a stream or future and runs a callback when the stream/future ends or when Finally is dropped.

FirstOk

Adapts a stream to a future by taking the first successful item yielded by the stream. If the stream ends before yielding an Ok then all the errors that were yielded by the stream are returned in a vector.

Infallible

Wraps a future or stream which can't fail (ie. has error type Void) and casts the error type to some inferred type.

LogError

Wraps a future which returns () and logs its error if it fails. LogError itself cannot fail and will always resolve to ().

LogErrors

Removes the errors from a stream and logs them.

NextOrElse

Takes the next item from the stream. If the stream ends then the provided callback is used to generate an error.

Until

Runs a stream or future until some condition is met.

Traits

FutureExt

Extension trait for Future.

StreamExt

Extension trait for Stream.

Functions

drop_notify

Create a (DropNotify, DropNotice) pair. DropNotice is a future that resolves to () when the corresponding DropNotify is dropped.

Type Definitions

BoxFuture
BoxSink
BoxStream
IoFuture
IoSink
IoStream