#networking #aeron #aeron-c-bindings #client-bindings #low-latency #aeron-client

rusteron-client

Provides core client functionalities for interacting with the Aeron protocol, such as establishing connections, subscribing, and publishing. It uses the Aeron C bindings from aeron-client module.

128 releases

0.1.160 Dec 5, 2025
0.1.159 Nov 23, 2025
0.1.157 Oct 29, 2025
0.1.150 Jul 27, 2025
0.1.36 Nov 12, 2024

#1222 in Network programming

Download history 289/week @ 2025-10-18 1228/week @ 2025-10-25 1282/week @ 2025-11-01 1120/week @ 2025-11-08 2731/week @ 2025-11-15 3015/week @ 2025-11-22 3104/week @ 2025-11-29 1854/week @ 2025-12-06 1385/week @ 2025-12-13 310/week @ 2025-12-20 339/week @ 2025-12-27 906/week @ 2026-01-03 1583/week @ 2026-01-10 3132/week @ 2026-01-17 2779/week @ 2026-01-24 3255/week @ 2026-01-31

10,864 downloads per month

MIT/Apache

17MB
312K SLoC

Java 177K SLoC // 0.2% comments C 52K SLoC // 0.0% comments C++ 47K SLoC // 0.1% comments Rust 35K SLoC // 0.0% comments AsciiDoc 638 SLoC // 0.1% comments Batch 423 SLoC // 0.6% comments PowerShell 178 SLoC // 0.1% comments Python 72 SLoC Shell 33 SLoC // 0.1% comments

Contains (JAR file, 44KB) aeron/gradle/wrapper/gradle-wrapper.jar

rusteron-client

rusteron-client is a core component of the Rusteron project.
It provides a Rust wrapper around the Aeron C client API, enabling high-performance, low-latency communication in distributed systems built with Rust.

This crate supports publishing, subscribing, and managing Aeron resources, while exposing a flexible and idiomatic interface over unsafe C bindings.
Due to its reliance on raw FFI, developers must take care to manage resource lifetimes and concurrency correctly.


Features

  • Client Setup – Create and start an Aeron client using Rust.
  • Publications – Send messages via offer() or try_claim().
  • Subscriptions – Poll for incoming messages and handle fragments.
  • Callbacks & Handlers – React to driver events like availability, errors, and stream lifecycle changes.
  • Cloneable Wrappers – All client types are cloneable and share ownership of the underlying C resources.
  • Automatic Resource Management – Objects created with .new() automatically call *_init and *_close, where supported.
  • Result-Focused API – Methods returning primitive C results return Result<T, AeronCError> for ergonomic error handling.
  • Efficient String Interop – Inputs use &CStr, outputs return &str, giving developers precise allocation control.

General Patterns

  • new() Initialization: Automatically calls the corresponding *_init method.
  • Automatic Cleanup (Partial): When possible, Drop will invoke the appropriate *_close or *_destroy methods.
  • Manual Resource Responsibility: For methods like set_aeron() or where lifetimes aren't managed internally, users are responsible for safety.
  • Handlers Must Be Leaked and Released: Callbacks passed to the C layer require explicit memory management using Handlers::leak(...) and Handlers::release(...).

Handlers and Callbacks

Handlers allow users to customize responses to Aeron events (errors, image availability, etc). There are two ways to use them:

This is the most performant and idiomatic approach.

use rusteron_client::*;

pub struct MyErrorHandler;

impl AeronErrorHandlerCallback for MyErrorHandler {
    fn handle_aeron_error_handler(&mut self, code: i32, msg: &str) {
        eprintln!("Aeron error ({}): {}", code, msg);
    }
}

Dependencies

~4–11MB
~203K SLoC