Crates.io | wiring |
lib.rs | wiring |
version | 0.2.2 |
source | src |
created_at | 2024-02-14 04:36:32.074743 |
updated_at | 2024-07-08 23:15:18.015238 |
description | An async binary serialization framework with channels support |
homepage | |
repository | https://github.com/louaykamel/wiring |
max_upload_size | |
id | 1139448 |
size | 195,471 |
Welcome to Wiring, an advanced asynchronous serialization framework for Rust. Wiring is designed to enable efficient communication patterns in concurrent applications by allowing the transmission of types and channels over asynchronous streams.
Wiring
, Unwiring
macros to automatically derive de/serialization, with an optional custom numeric type tag for larger enums.Wiring provides a procedural macros Wiring, Unwiring
to facilitate the automatic implemenations, tagging of enum variants. The macro can be used as follows:
#[derive(Wiring, Unwiring)]
#[tag(u8)]
enum MyEnum {
VariantOne { reply: tokio::sync::oneshot::Sender<()>, request: String, },
VariantN,
}
The tag
attribute is optional. By default, a u16
is used for tagging, which ensures future-proofing. However, for better space and bandwidth efficiency, it is recommended to use a u8
.
u16
allows support for up to u16::MAX
variants. If your enum has fewer or more variants, consider specifying a custom tag type using the tag attribute.u8
is recommended for space and bandwidth efficiency, it’s prudent to specify a larger tag type upfront to prevent breaking changes in the future.To include Wiring in your Rust project, add the following to your Cargo.toml
file:
[dependencies]
wiring = "0.2"
Check https://github.com/louaykamel/wiring/tree/master/examples folder.
Contributions to Wiring are welcome! Please read our contributing guidelines to get started on helping improve the project.
Wiring is licensed under the Apache 2.0 License - see the https://github.com/louaykamel/wiring/blob/master/LICENSE file for details.