channels 0.9.2

Bidirectional channel-like communication over generic Read/Write streams
Documentation

license-badge version-badge downloads-badge

tests-badge docs-badge

Repos

This library is available in the following languages:

  • Rust
  • C (work in progress)

Sender/Receiver types to be used with any type that implements std::io::Read and std::io::Write.

This crate is similar to std::sync::mpsc in terms of the API, and most of the documentation for that module carries over to this crate.

Don't think of these channels as a replacement for std::sync::mpsc, but as another implementation that works over many different transports.

These channels are meant to be used in combination with network sockets, local sockets, pipes, etc.

The differences are:

  • Channels will block, unless the underlying stream is set as non-blocking.
  • The amount of messages that can be queued up before reading is dependent on the underlying stream.

:warning: Warning: This library does not support transparent encryption or authentication of the data. This functionality must be implemented by a Serializer and Deserializer.

Features

  • statistics: Capture statistic data like: total bytes sent/received, timestamp of last packet, etc
  • tokio: Adds support for sending/receiving types asynchronously.
  • cbor: Adds support for sending/receiving any type with ciborium.

Default features

Examples

See: examples/