19 releases (9 breaking)
0.10.0 | Aug 30, 2023 |
---|---|
0.8.0 | Jun 18, 2023 |
0.6.7 | Feb 23, 2023 |
0.6.1 | Dec 24, 2022 |
0.1.1 | Jul 23, 2022 |
#1148 in Network programming
399 downloads per month
92KB
2.5K
SLoC
channels-rs
A crate that allows for easy and fast communication between processes, threads and systems.
Repos
This library is available in the following languages:
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.
Features
- 🚀 Async & Sync API
- 📥 Transparent compression
- 🔑 Transparent authentication with
HMAC-SHA3-512
- ➕ Transparent checksumming with CRC
cargo features
cbor
: Adds support for sending/receiving any type withciborium
.crc
: Adds support for verifying data with CRC checksums.flate2
: Adds support for compressing data withflate2
.hmac
: Adds support for cryptographically signing data withhmac
andsha3
.json
: Adds support for sending/receiving any type withserde_json
.statistics
: Capture statistic data like: total bytes sent/received, timestamp of last packet, etctokio
: Adds support for sending/receiving types asynchronously.
cargo default features
serde
: Adds support for sending/receiving any type which implementsserde::Serialize
andserde::Deserialize
.bincode
: Adds support for sending/receiving any type withbincode
.
Examples
See: examples/
Dependencies
~0.3–2.4MB
~42K SLoC