8 unstable releases (3 breaking)
Uses new Rust 2024
| 0.4.1 | Aug 19, 2025 |
|---|---|
| 0.4.0 | Jul 15, 2025 |
| 0.3.0 | Jun 16, 2025 |
| 0.2.2 | Feb 26, 2025 |
| 0.1.1 | Jan 28, 2025 |
#534 in Network programming
311 downloads per month
380KB
9K
SLoC
watermelon
watermelon is an independent and opinionated implementation of the NATS
client protocol and the NATS client API for Rust. The goal of the project
is to produce a more secure, composable and idiomatic implementation compared
to the official one.
Most users of this project will depend on the watermelon crate directly and on
watermelon-proto and watermelon-nkeys via the re-exports in watermelon.
Watermelon is divided into multiple crates, all hosted in the same monorepo.
Philosophy and Design
- Security by design: this library uses type-safe and checked APIs, such as
Subject, to prevent entire classes of errors and security vulnerabilities. - Layering and composability: the library is split into layers. You can get a high-level, batteries included implementation via
watermelon, or depend directly on the lower-level crates for maximum flexibility. - Opinionated, Rusty take: we adapt the Go-style API of nats-server and apply different trade-offs to make NATS feel more Rusty. We sacrifice a bit of performance by enabling server verbose mode, and get better errors in return.
- Legacy is in the past: we only support
nats-server >= 2.10and avoid legacy versions compatibility code like the STARTTLS-style TLS upgrade path or fallbacks for older JetStream APIs. We also prefer pull consumers over push consumers given the robust flow control, easier compatibility with multi-account environments and stronger permissions handling. - Permissive licensing: dual licensed under MIT and APACHE-2.0.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Dependencies
~17–46MB
~1M SLoC