A Rust crate for easy protocol definitions with built-in networking support and middleware.
Protocol is a Rust crate that provides easy protocol definitions through a custom derive macro, enabling structured data to be serialized and sent over IO streams. It solves the problem of implementing communication protocols by automating trait implementations and offering built-in networking support for TCP and UDP.
Rust developers building networked applications, game servers, or any system requiring structured communication protocols over streams.
Developers choose Protocol for its simplicity in defining protocols with derive macros, built-in networking modules, and extensible middleware, reducing boilerplate and accelerating development of robust communication layers.
Easy protocol definitions in Rust
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically implements the Parcel trait for user-defined types with #[derive(protocol::Protocol)], reducing boilerplate for defining structured data.
Provides dedicated TCP and UDP modules for sending and receiving Parcel types, simplifying setup for stream-based communication.
Offers a generic middleware library with built-in compression support, allowing easy transformation of data without modifying core logic.
Supports enum transmission via string names or integer discriminators, with attributes to customize serialization names and discriminators.
Limited to Rust applications; lacks native support for cross-language serialization, which can hinder integration with non-Rust systems.
When using integer discriminators, the README warns that reordering enum variants breaks the protocol, requiring careful management of changes.
Relies on custom derive macros, which may be challenging for developers unfamiliar with Rust's macro system or who prefer explicit trait implementations.