Expand description
Safe, idiomatic Rust wrapper for the Aeron C++ API.
This crate binds directly to the Aeron C++ client using cxx,
providing zero-cost abstractions over publications, subscriptions, images, and the
embedded media driver. Closures are passed cleanly across the FFI boundary via
trampolines, so the API feels native to Rust.
§Quick start
use aeron_glide::AeronClient;
let mut client = AeronClient::new().unwrap();
client.start();
let mut pub1 = client.add_publication("aeron:ipc", 1001).unwrap();
let mut sub1 = client.add_subscription("aeron:ipc", 1001).unwrap();
// Publish
while pub1.offer(b"hello aeron") < 0 {}
// Subscribe
sub1.poll(10, |data| {
println!("Received: {}", std::str::from_utf8(data).unwrap());
});§Features
- IPC and UDP transports via
ChannelBuilder - Publications (
Publication) and exclusive publications (ExclusivePublication) - Zero-copy publish via
Publication::try_claim - Fragment reassembly via
Subscription::poll_assembledwithControlledActionflow control - Image access for per-session stream inspection
- Counters reader for real-time driver statistics
- Embedded media driver (
MediaDriver) with full configuration - Archive client (behind the
archivefeature flag): recording, replay, listing, andReplayMerge
§Prerequisites
- CMake and a C++14 compiler (Aeron C++ is built from source automatically)
- A running Aeron media driver (use the included
mediadriverbinary orMediaDriver) - Java 17+ only if building with
--features archive
Modules§
Structs§
- Aeron
Client - Aeron client — the main entry point for creating publications and subscriptions.
- Channel
Builder - Builder for Aeron channel URIs (
aeron:ipcoraeron:udp?key=value|...). - Counters
Reader - Reader for the media driver’s CNC (Command and Control) counters.
- Exclusive
Publication - An exclusive publication — single-writer, lower overhead than
Publication. - Image
- A single publisher session as seen by a subscriber.
- Media
Driver - An embedded C media driver that manages shared memory buffers and handles publication/subscription matching.
- Publication
- A concurrent publication for sending messages on a channel+stream.
- Subscription
- A subscription for receiving messages on a channel+stream.
Enums§
- Controlled
Action - Flow-control actions for
poll_assembledwhen the handler returns aControlledAction. Matches Aeron’sControlledPollActionenum values. - Idle
Strategy - Idle strategy for media driver threads.
- Threading
Mode - Threading model for the embedded media driver.
Traits§
- Poll
Action - Trait that allows
poll_assembledto accept handlers returning either()orControlledAction. Closures returning()map toControlledAction::Continue.