1 unstable release

0.35.1 Jul 1, 2024

#1663 in Network programming

Download history 197/week @ 2024-06-27 350/week @ 2024-07-04 1354/week @ 2024-07-11 1700/week @ 2024-07-18 2666/week @ 2024-07-25 2212/week @ 2024-08-01 1880/week @ 2024-08-08 2296/week @ 2024-08-15 2696/week @ 2024-08-22 1718/week @ 2024-08-29 1820/week @ 2024-09-05 1297/week @ 2024-09-12 203/week @ 2024-09-19 52/week @ 2024-09-26 15/week @ 2024-10-03

1,746 downloads per month

Apache-2.0

695KB
12K SLoC

A Rust client for the NATS messaging system.

Motivation

Rust may be one of the most interesting new languages the NATS ecosystem has seen. We believe this client will have a large impact on NATS, distributed systems, and embedded and IoT environments. With Rust, we wanted to be as idiomatic as we could be and lean into the strengths of the language. We moved many things that would have been runtime checks and errors to the compiler, most notably options on connections, and having subscriptions generate multiple styles of iterators since iterators are first-class citizens in Rust. We also wanted to be aligned with the NATS philosophy of simple, secure, and fast!

Clients

There are two clients available in two separate crates:

async-nats

License Apache 2 Crates.io Documentation Build Status

Async Tokio-based NATS client.

Supports:

  • Core NATS
  • JetStream API
  • JetStream Management API
  • Key Value Store
  • Object Store
  • Service API

The API is stable, however it remains on 0.x.x versioning, as async ecosystem is still introducing a lot of ergonomic improvements. Some of our dependencies are also considered stable, yet versioned <1.0.0, like rustls, which might introduce breaking changes that can affect our users in some way.

Feature flags

Feature flags are Documented in Cargo.toml and can be viewed here.

nats

License Apache 2 Crates.io Documentation Build Status

Legacy synchronous client that supports:

  • Core NATS
  • JetStream API
  • JetStream Management API
  • Key Value Store
  • Object Store

This client does not get updates, unless those are security fixes. Please use the new async-nats crate.

Documentation

Please refer each crate docs for API reference and examples.

Additionally Check out NATS by example - An evolving collection of runnable, cross-client reference examples for NATS.

Feedback

We encourage all folks in the NATS and Rust ecosystems to help us improve this library. Please open issues, submit PRs, etc. We're available in the rust channel on the NATS slack as well!

Dependencies

~20–44MB
~1M SLoC