postage/
lib.rs

1//! **The feature-rich, portable async channel library.**
2//!
3//! # Why use Postage?
4//! - Includes a **rich set of channels.**
5//!   - [barrier](./barrier/index.html), a oneshot channel that transmits when the sender half is dropped.
6//!   - [broadcast](./broadcast/index.html), a lossless multi-producer, multi-consumer broadcast channel with backpressure (no lagging!).
7//!   - [dispatch](./dispatch/index.html), a multi-producer, multi-consumer queue.
8//!   - [mpsc](./mpsc/index.html), a multi-producer, single-consumer channel.
9//!   - [oneshot](./oneshot/index.html), a oneshot transfer channel.
10//!   - [watch](./watch/index.html), a state distribution channel with a value that can be borrowed.
11//! - Works with **any executor.**
12//!   - Currently regressions are written for `tokio` and `async-std`.
13//!   - With the `futures-traits` feature, channels implement the futures `Sink/Stream` traits.
14//! - **Throughly tested.**  
15//!   - Channels have full unit test coverage, and integration test coverage with multiple async executors.
16//! - Comes with **built-in [Sink](./sink/trait.Sink.html) and [Stream](./stream/trait.Stream.html) combinators.**
17//!   - Sinks can be chained, and filtered.
18//!   - Streams can be chained, filtered, mapped, and merged.
19//!   - With the `logging` feature, Sinks and streams can log their values.  This is really helpful when debugging applications.
20//!
21//! See [the readme](https://github.com/austinjones/postage-rs#benchmarks) for benchmarks.
22//!
23//! ## Cargo features:
24//! - `blocking (default)` - enables [Sink::blocking_send](./sink/trait.Sink.html#method.blocking_send) and [Stream::blocking_recv](./stream/trait.Stream.html#method.blocking_recv)
25//! - `debug` - enables _extremely verbose_ internal log statements.
26//! - `futures-traits` - enables `futures::Sink` and `futures::Stream` implementations for the postage channels.  Compatible with `v0.3`.
27//! - `logging (default)` - enables the enables [Sink::log(Level)](./sink/trait.Sink.html#method.log) and [Stream::log(Level)](./stream/trait.Stream.html#method.log) combinators.
28
29mod channels;
30mod context;
31mod logging;
32pub mod prelude;
33pub mod sink;
34pub mod stream;
35mod sync;
36
37#[cfg(feature = "futures-traits")]
38mod futures;
39
40pub use channels::barrier;
41pub use channels::broadcast;
42pub use channels::dispatch;
43pub use channels::mpsc;
44pub use channels::oneshot;
45pub use channels::watch;
46
47pub use context::Context;
48
49#[cfg(test)]
50mod test;