Skip to main content

Crate aeron_glide

Crate aeron_glide 

Source
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

§Prerequisites

  • CMake and a C++14 compiler (Aeron C++ is built from source automatically)
  • A running Aeron media driver (use the included mediadriver binary or MediaDriver)
  • Java 17+ only if building with --features archive

Modules§

archivearchive
ffi

Structs§

AeronClient
Aeron client — the main entry point for creating publications and subscriptions.
ChannelBuilder
Builder for Aeron channel URIs (aeron:ipc or aeron:udp?key=value|...).
CountersReader
Reader for the media driver’s CNC (Command and Control) counters.
ExclusivePublication
An exclusive publication — single-writer, lower overhead than Publication.
Image
A single publisher session as seen by a subscriber.
MediaDriver
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§

ControlledAction
Flow-control actions for poll_assembled when the handler returns a ControlledAction. Matches Aeron’s ControlledPollAction enum values.
IdleStrategy
Idle strategy for media driver threads.
ThreadingMode
Threading model for the embedded media driver.

Traits§

PollAction
Trait that allows poll_assembled to accept handlers returning either () or ControlledAction. Closures returning () map to ControlledAction::Continue.