{"id":24074323,"url":"https://github.com/threadexio/channels-rs","last_synced_at":"2025-07-05T18:08:18.641Z","repository":{"id":57714429,"uuid":"517059898","full_name":"threadexio/channels-rs","owner":"threadexio","description":"📦🚀 A crate that allows for easy and fast communication between processes, threads and systems.","archived":false,"fork":false,"pushed_at":"2024-10-10T13:03:20.000Z","size":1859,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-30T06:07:08.633Z","etag":null,"topics":["async","deserialization","io","networking","protocol","rust","rust-async","serde","serialization"],"latest_commit_sha":null,"homepage":"https://threadexio.github.io/channels-rs","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/threadexio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-23T13:05:08.000Z","updated_at":"2025-04-25T05:10:31.000Z","dependencies_parsed_at":"2024-02-18T10:31:47.438Z","dependency_job_id":"1c2fda79-06eb-475c-bd53-a8f971a7b1b2","html_url":"https://github.com/threadexio/channels-rs","commit_stats":{"total_commits":57,"total_committers":1,"mean_commits":57.0,"dds":0.0,"last_synced_commit":"1e395f5df396c40e02825fdc99f30a47cfeef21d"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/threadexio/channels-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threadexio%2Fchannels-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threadexio%2Fchannels-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threadexio%2Fchannels-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threadexio%2Fchannels-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/threadexio","download_url":"https://codeload.github.com/threadexio/channels-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threadexio%2Fchannels-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263029224,"owners_count":23402355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","deserialization","io","networking","protocol","rust","rust-async","serde","serialization"],"created_at":"2025-01-09T18:10:23.482Z","updated_at":"2025-07-05T18:08:18.613Z","avatar_url":"https://github.com/threadexio.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[crates-io]: https://crates.io/crates/channels\n[docs-rs]: https://docs.rs/channels/latest/channels\n[github-actions]: https://github.com/threadexio/channels-rs/actions/workflows/ci.yaml\n\n[license-badge]: https://img.shields.io/github/license/threadexio/channels-rs?style=for-the-badge\u0026logo=github\u0026label=license\u0026labelColor=%23000\u0026color=%236e00f2\n[tests-badge]: https://img.shields.io/github/actions/workflow/status/threadexio/channels-rs/ci.yaml?style=for-the-badge\u0026logo=github\u0026label=tests\u0026labelColor=%23000\u0026color=%239500d6\n[version-badge]: https://img.shields.io/crates/v/channels?style=for-the-badge\u0026logo=rust\u0026label=crates.io\u0026labelColor=%23000\u0026color=%23bc00ba\n[docs-badge]: https://img.shields.io/docsrs/channels?style=for-the-badge\u0026logo=docs.rs\u0026labelColor=%23000\u0026color=%23e2009e\n[downloads-badge]: https://img.shields.io/crates/d/channels?style=for-the-badge\u0026label=downloads\u0026labelColor=%23000\u0026color=%23ff0089\n\n[examples]: https://github.com/threadexio/channels-rs/tree/master/examples\n[spec]: https://github.com/threadexio/channels-rs/blob/master/spec/PROTOCOL.md\n[license]: https://github.com/threadexio/channels-rs/blob/master/LICENSE\n[art-license]: https://github.com/threadexio/channels-rs/blob/master/assets/LICENSE\n\n\u003cdiv class=\"rustdoc-hidden\"\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/threadexio/channels-rs/master/assets/logo.transparent.svg\" width=\"640\" alt=\"logo\"\u003e\n\n  \u003cp\u003e\n    Easy and fast communication between processes, threads and systems.\n  \u003c/p\u003e\n\n  [![license-badge]][crates-io]\n  [![tests-badge]][github-actions]\n  [![version-badge]][crates-io]\n  [![docs-badge]][docs-rs]\n  [![downloads-badge]][crates-io]\n\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n\u003c/div\u003e\n\nSender/Receiver types for communicating with a channel-like API across generic IO streams.\nIt takes the burden on serializing, deserializing and transporting data off your back and\nlet's you focus on the important logic of your project.\n\n## Contents\n\n* [Contents](#contents)\n* [Examples](#examples)\n* [Features](#features)\n* [How it works](#how-it-works)\n* [License](#license)\n\n## Examples\n\n```toml\n[dependencies.channels]\nversion = \"0.13\"\nfeatures = [\"full\"]\n```\n\n```rust no_run\nuse tokio::net::TcpStream;\n\nuse serde::{Deserialize, Serialize};\n\n#[derive(Debug, Serialize, Deserialize)]\nenum Message {\n    Ping,\n    Pong\n}\n\n#[tokio::main]\nasync fn main() {\n    let stream = TcpStream::connect(\"127.0.0.1:8080\").await.unwrap();\n    let (r, w) = stream.into_split();\n    let (mut tx, mut rx) = channels::channel::\u003cMessage, _, _\u003e(r, w);\n\n    loop {\n        match rx.recv().await.unwrap() {\n            Message::Ping =\u003e {\n                println!(\"pinged!\");\n                tx.send(Message::Pong).await.unwrap();\n            }\n            Message::Pong =\u003e {\n                println!(\"ponged!\");\n            }\n        }\n    }\n}\n```\n\nFor more, see: [examples/][examples]\n\n## Features\n\n| Flag          | Description                                                                                               |\n|---------------|-----------------------------------------------------------------------------------------------------------|\n| `aead`        | Encrypt and authenticate data with [`ring::aead`].                                                        |\n| `bincode`     | Serialize/Deserialize data with [`bincode`]. (Enabled by default)                                         |\n| `borsh`       | Serialize/Deserialize data with [`borsh`].                                                                |\n| `cbor`        | Serialize/Deserialize data with [`ciborium`].                                                             |\n| `core2`       | Support for [`core2::io::{Read, Write}`][].                                                               |\n| `crc`         | Validate data with a CRC checksum.                                                                        |\n| `deflate`     | Compress data with DEFLATE.                                                                               |\n| `embedded-io` | Support for [`embedded_io::{Read, Write}`][].                                                             |\n| `full-io`     | Enable support for all of the IO traits.                                                                  |\n| `full-serdes` | Enable features: `aead`, `bincode`, `borsh`, `cbor`, `crc`, `deflate`, `hmac`, `json`.                    |\n| `futures`     | Support for [`futures::io::{AsyncRead, AsyncWrite}`][].                                                   |\n| `hmac`        | Authenticate data with a HMAC using [`ring::hmac`].                                                       |\n| `json`        | Serialize/Deserialize data with [`serde_json`].                                                           |\n| `smol`        | Support for [`smol::io::{AsyncRead, AsyncWrite}`][].                                                      |\n| `statistics`  | Collect IO metrics such as total bytes sent/received. See: [`Statistics`][].                              |\n| `std`         | Support for [`std::io::{Read, Write}`][]. If disabled also makes the crate `no_std`. (Enabled by default) |\n| `tokio`       | Support for [`tokio::io::{AsyncRead, AsyncWrite}`][].                                                     |\n\nNo two features of the crate are mutually exclusive. Instead, everything is implemented in\na way to be infinitely extensible. This means, that even if you have other IO traits or another\nway to serialize or deserialize data, you can either add support for them directly in your own\nproject by using the rich type system.\n\n## How it works\n\nChannels implements a communication protocol that allows sending and receiving data in\nframes. The main API of the crate is intended to work over IO traits. However, if desired,\nthe logic of the underlying protocol is available standalone without coupling it to the\nusage of any IO traits. It works over _any_ stream synchronous or asynchronous with first\nclass support for following IO traits:\n\n* [`std::io::{Read, Write}`][]\n* [`tokio::io::{AsyncRead, AsyncWrite}`][]\n* [`futures::io::{AsyncRead, AsyncWrite}`][]\n* [`core2::io::{Read, Write}`][]\n* [`smol::io::{AsyncRead, AsyncWrite}`][]\n* [`embedded_io::{Read, Write}`][]\n\nSupport for each IO trait can be enabled via the corresponding feature flag. See: [Features](#features).\nYou can read more about how the underlying communication protocol works [here][spec].\n\n## License\n\n* All code in this repository is licensed under the MIT license, a copy of which can be\n  found [here][license].\n\n* All artwork in this repository is licensed under [Creative Commons Attribution-NonCommercial 4.0 International](https://creativecommons.org/licenses/by-nc/4.0/). A copy of the license can be found [here][art-license].\n\n[`std::io::{Read, Write}`]: https://doc.rust-lang.org/stable/std/io\n[`tokio::io::{AsyncRead, AsyncWrite}`]: https://docs.rs/tokio/latest/tokio/io\n[`futures::io::{AsyncRead, AsyncWrite}`]: https://docs.rs/futures/latest/futures/io\n[`core2::io::{Read, Write}`]: https://docs.rs/core2\n[`smol::io::{AsyncRead, AsyncWrite}`]: https://docs.rs/smol\n[`embedded_io::{Read, Write}`]: https://docs.rs/embedded-io\n[`Statistics`]: https://docs.rs/channels/latest/channels/struct.Statistics.html\n\n[`ring::aead`]: https://docs.rs/ring/latest/ring/aead/index.html\n[`bincode`]: https://github.com/bincode-org/bincode\n[`borsh`]: https://github.com/near/borsh-rs\n[`ciborium`]: https://github.com/enarx/ciborium\n[`ring::hmac`]: https://docs.rs/ring/latest/ring/hmac/index.html\n[`serde_json`]: https://github.com/serde-rs/json\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreadexio%2Fchannels-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthreadexio%2Fchannels-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreadexio%2Fchannels-rs/lists"}