Skip to main content

Crate rusteron_archive

Crate rusteron_archive 

Source
Expand description

§rusteron-archive

rusteron-archive provides a fast, idiomatic Rust API over the Aeron C Archive client. It includes the client APIs from rusteron-client and adds recording, replay, replication and persistent subscriptions.


Rusteron is sponsored and maintained by GSR, a global leader in algorithmic trading and market making in digital assets.

Rusteron has been running in production in GSR’s low-latency trading system since the beginning of 2025. It is mature and battle tested.

It is developed under the GSR GitHub organisation. We welcome contributions, feedback and discussion. To integrate or contribute, open an issue or reach out directly.


§Overview

On macOS, precompiled static libraries let you build without cmake or Java:

rusteron-archive = { version = "0.2", features = ["static", "precompile"] }

If you prefer a rustls-only downloader dependency:

rusteron-archive = { version = "0.2", features = ["static", "precompile-rustls"] }

§Installation

Add rusteron-archive to your Cargo.toml, depending on your setup:

# Dynamic linking (default)
rusteron-archive = "0.2"

# Static linking
rusteron-archive = { version = "0.2", features = ["static"] }

# Static linking with precompiled C libraries (best for Mac users, no Java/cmake needed)
rusteron-archive = { version = "0.2", features = ["static", "precompile"] }

# Static linking with precompiled C libraries using rustls downloader
rusteron-archive = { version = "0.2", features = ["static", "precompile-rustls"] }

With the default dynamic configuration, the Aeron C libraries must be available at runtime. The static option embeds them in the binary.


§Development

Build tasks use just. Run just to list commands, or cargo install just if needed.


§Features

  • Record Aeron streams for replay or archival.
  • Replay previously recorded messages.
  • Persistent subscriptions replay recorded history, then join the live stream (Aeron Archive 1.51.0). See below.
  • Publish to and subscribe from Aeron channels.
  • Receive events such as new publications, subscriptions and errors.
  • Objects built with new() call *_init and clean up with *_close or *_destroy when dropped. Other objects are not cleaned up automatically.
  • new() and setter methods accept &CStr; getter methods return &str.

§General patterns

§Cloneable wrappers

Wrapper types in rusteron-archive implement Clone and share the same underlying Aeron C resource. The exceptions are structs Aeron only hands to callbacks, such as AeronArchiveRecordingDescriptor; see Callback arguments are borrowed. For shallow copies of raw structs, use .clone_struct() (unsafe when the struct holds pointers such as strings).

§Mutable and immutable APIs

Most methods take &self and update the C resource without transferring ownership.

§Resource management caveats

Automatic cleanup applies only to new() constructors. Setters that take another wrapper (e.g. set_aeron()) keep it alive for as long as the context.

archive.get_archive_context(), the pollers and other getters return a Ref, which borrows the archive. The compiler stops you from dropping or closing the archive while you still use the result. Borrowed wrappers do not retain callbacks. Keep any returned Handler alive while C can use it.

§Handlers and errors

Retained-callback setters take the callback by value (a closure or trait impl), keep it alive inside the registering resource, and return the Handler for optional state access. For synchronous polling, pass a stack closure:

// retained (e.g. an error handler on the archive context)
archive_context.set_error_handler(Some(|code: i32, msg: &str| eprintln!("archive error {code}: {msg}")))?;

// synchronous poll, note the fragment-limit argument
subscription.poll_fn(|buf: &[u8], header: &AeronHeader| println!("{} bytes", buf.len()), 10)?;

Handlers::NONE fits any optional callback slot.

§Why replaced handlers stay alive

AeronArchiveAsyncConnect::new_with_aeron() copies the C archive context, including its handler pointers, before you poll for the connection. Replacing a handler on the original context only changes that context. The connection keeps using the earlier handler. Configure handlers before starting a connection if it should use them.

Handler uses Arc, but C copies raw pointers. Those copies do not increase the Rust reference count or tell Rust when C has finished using the handler.

Rusteron keeps every registered handler until the last owner of the registering context drops. Async-connect handles and connected archives own that context, so dropping your own context variable does not free its handlers while a connection needs them. Dropping the returned Handler, replacing it, or setting it to None does not release the earlier closure or its captured values. A Handler clone held by your code keeps it alive longer.

This keeps old handlers even if no connection used them. It costs memory, but avoids tracking each copied pointer through connection setup, failure, cancellation and cleanup. Applications that set a handler once have no replaced handlers to reclaim. See why Rusteron manages handler cleanup.

This example assumes ctx contains the channels of a running archive and uses aeron:

use std::sync::{Arc, atomic::{AtomicUsize, Ordering}};

let old_calls = Arc::new(AtomicUsize::new(0));
let old_capture = old_calls.clone();
ctx.set_error_handler(Some(move |_, _: &str| {
    old_capture.fetch_add(1, Ordering::SeqCst);
}))?;

// Aeron copies the old handler pointer here, before poll_blocking().
let connecting = AeronArchiveAsyncConnect::new_with_aeron(ctx, aeron)?;
let new_calls = Arc::new(AtomicUsize::new(0));
let new_capture = new_calls.clone();
ctx.set_error_handler(Some(move |_, _: &str| {
    new_capture.fetch_add(1, Ordering::SeqCst);
}))?;
let archive = connecting.poll_blocking(Duration::from_secs(5))?;

// Invoke each context's handler directly to check which callback it holds.
archive.get_archive_context().invoke_error_handler(1, 0, c"connected context");
ctx.invoke_error_handler(2, 0, c"original context");
assert_eq!(old_calls.load(Ordering::SeqCst), 1);
assert_eq!(new_calls.load(Ordering::SeqCst), 1);

The regression test starts an archive and checks that both closures stay alive until the last context owner drops, then get freed.

§Changing a callback without registering another handler

Register an AeronErrorHandlerSlot once, then use set to replace its callback or clear to remove it. The C handler stays registered.

use rusteron_archive::{AeronArchiveContext, AeronErrorHandlerSlot};
let ctx = AeronArchiveContext::new()?;
let handler = AeronErrorHandlerSlot::new();
ctx.set_error_handler(Some(handler.clone()))?;

let label = String::from("first");
handler.set(move |code, message| eprintln!("{label}: {code}: {message}"));
handler.set(|code, message| eprintln!("second: {code}: {message}"));
handler.clear();

Old callbacks and their captured values are freed after their last call finishes. Archive connections share the slot, so they also use the new callback.

Callbacks can change captured values. Captures must be owned and safe to move between threads. Calls to the same callback run one at a time. It can replace or clear itself, but calling itself again will deadlock. Each call takes two mutex locks and clones an Arc.

The runnable example needs no archive server:

cargo run -p rusteron-archive --features precompile,static --example replaceable_error_handler

The client, archive and media driver crates provide named slots for callbacks. For callbacks that return a value, choose what to return when empty. This slot returns AERON_ACTION_ABORT until you set a callback:

use rusteron_archive::{
    AeronControlledFragmentHandlerSlot,
    bindings::aeron_controlled_fragment_handler_action_t::AERON_ACTION_ABORT,
};

let handler = AeronControlledFragmentHandlerSlot::new(|| AERON_ACTION_ABORT);

Handler registration, callbacks, error checking and idle strategies work the same way here as in rusteron-client. See these sections of its documentation:

Archive control operations (start_recording, start_replay, stop_recording_subscription, …) return Result<_, AeronArchiveError>, which holds a typed code (AeronArchiveErrorCode) and the archive’s message. Constructors, async-connect and context setters return AeronCError; From<AeronArchiveError> for AeronCError keeps ? working across both.


§Documentation and guides

See these guides for configuration and examples:


§Safety considerations

  1. Aeron lifetime. Connect with AeronArchiveAsyncConnect::new_with_aeron(&archive_context, &aeron). The archive then keeps the client alive, and the two close in any order. set_aeron() also keeps the client alive, so AeronArchiveAsyncConnect::new() and aeron_archive_connect() are safe after the caller drops its Aeron. A client obtained with get_aeron() is borrowed. Publications and subscriptions made from it must drop before the context.
  2. Persistent subscription lifetime. A persistent subscription keeps the Aeron client and archive context given to its builder open until it closes. Building it also points the archive context at the subscription’s client, so build with PersistentSubscriptionBuilder::new_with_aeron(&archive_context, &aeron), which sets one client on both. Without a client the subscription makes its own and closes it, and the archive context must not be used again afterwards.
  3. Deferred close. archive.close() is deferred while a clone is alive and does not close the Aeron client. unsafe close_now() frees it immediately, so any surviving handle then dangles.
  4. Automatic handler cleanup. Handlers are reference-counted. Owned contexts keep registered callbacks alive through C cleanup. Replacing a handler on an owned context keeps the earlier closure alive too. See Why replaced handlers stay alive. A panic in a ReplayMerge poll handler unwinds to the caller and the fragments are delivered again on the next poll. A panic in a persistent subscription handler or listener is caught and raised by its poll. A panic in an archive callback fired later is logged and the client continues. See Panics in callbacks.
  5. Thread safety. Handles use Rc and stay on the thread that created them, unless the multi-threaded feature is enabled (see the root README).

§Typical workflow

  1. Initialise the client and archive contexts.
  2. Start recording a specific channel and stream.
  3. Publish messages to the stream.
  4. Stop recording once complete.
  5. Locate the recording using archive queries.
  6. Configure the replay target and channel.
  7. Subscribe and receive the replayed messages.

See examples/record_and_replay.rs for this workflow end to end (cargo run --release --features "static precompile" --example record_and_replay).


§Replaying an empty recording

AeronArchiveReplayParams uses position(-1) to start at the recording’s start position. Use length(-2) to replay all available data and stop. An empty recording returns AeronArchiveErrorCode::EmptyRecording, whether it is still recording or has stopped. Use length(-1) to follow a live recording. That replay waits for new messages when the recording is empty. These values come from aeron_archive.h.

use rusteron_archive::AeronArchiveReplayParams;

let replay_available = AeronArchiveReplayParams::builder()
    .position(-1)
    .length(-2)
    .build()?;
let follow_live = AeronArchiveReplayParams::builder()
    .position(-1)
    .length(-1)
    .build()?;

Truncating a recording stops its active replays. Stop recording before calling truncate_recording.

An Archive context can create its own Aeron client. set_client_name sets that client’s name and the name in the Archive control session counter. Names must fit in 100 UTF-8 bytes. If you supply an Aeron client with set_aeron, set that client’s name on its own AeronContext.


§Duty cycle

Each object is driven by its own call, once a cycle:

ObjectCallNotes
Aeron clientNothing with its conductor thread (the default). With the agent invoker, aeron.main_do_work().archive.do_work() makes this call for you.
AeronArchivearchive.do_work()Runs an agent-invoker client’s conductor, then hands one recording signal to the context’s consumer, or one archive error to its error handler. With a conductor thread only the second part is left, and it can be skipped if you use neither a signal consumer nor errors for requests no longer awaited, because blocking calls dispatch the signals they meet.
Persistent subscriptionps.poll_fn(..)Drives its own archive client. With the agent invoker every poll also runs the client’s conductor, so many persistent subscriptions on one client should use its conductor thread.
AeronArchiveReplayMergemerge.poll_fn(..)Until it has merged or failed, poll only the merge and leave its archive client alone. archive.do_work(), poll_for_error and blocking calls read the same responses, skip the merge’s, and stall it until its progress timeout. Archive errors come back as Err from the merge’s poll.
loop {
    archive.do_work()?;
    ps.poll_fn(|message, _header| { /* a replayed or live message */ }, 100)?;
}

Each persistent subscription has its own Archive client. Every poll checks its control session before reading the live image. On two 4-vCPU Azure VMs on 2026-10-09, an idle poll took 22 to 24 ns with the client’s conductor thread, compared with 8 to 12 ns for a plain subscription. With 100 persistent subscriptions, the per-subscription poll took 35 ns on AMD and 43 ns on Intel.

With the agent invoker, every poll also runs the conductor. An idle poll then took 54 to 62 ns, or 69 ns on AMD and 107 ns on Intel with 100 subscriptions. The conductor thread took longer to bring 100 subscriptions to LIVE, 3.6 to 3.8 s compared with about 0.8 s for the invoker. Its 16 ms idle sleep, AERON_CLIENT_IDLE_SLEEP_DURATION, may explain that difference. These measurements precede the run in BENCHMARKS.md.

Blocking archive calls idle with the C client’s default backoff strategy between polls (Aeron C++ yields instead); archive_context.set_idle_strategy(..) replaces it.

archive.do_work() fails only on an archive error its context has no error handler for. Client faults go to the client’s error handler, and a lost archive shows as archive.get_control_response_subscription().is_connected() turning false.


§Persistent subscriptions

A persistent subscription replays a recording from a start position, then merges into the live stream. A consumer catches up on history without missing new messages and without a gap at the handover. It was introduced in Aeron Archive 1.51.0.

Rusteron exposes it through PersistentSubscriptionBuilder::new_with_aeron(&archive_context, &aeron) (one client for the subscription and its archive context), build() and the PersistentSubscriptionListener trait. It is a 1:1 wrapper over the Aeron C API (aeron_archive_persistent_subscription_*) and mirrors Aeron’s PersistentSubscription.Context field for field.

use rusteron_archive::*;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;

// `archive` is a connected AeronArchive; record + publish history first, then resolve recording_id.
let live_channel = "aeron:ipc";
let stream_id = 1001;

struct MyListener { live_joined: Arc<AtomicUsize> }
impl PersistentSubscriptionListener for MyListener {
    fn on_live_joined(&self) { self.live_joined.fetch_add(1, Ordering::SeqCst); }
    fn on_live_left(&self)  { /* fell back to replay */ }
    fn on_error(&self, code: i32, msg: &str) { eprintln!("ps error {code}: {msg}"); }
}
let live_joined = Arc::new(AtomicUsize::new(0));

// one client for the subscription and its archive context
let ps = PersistentSubscriptionBuilder::new_with_aeron(&archive_context, &aeron)?
    .live_channel(live_channel)?        // the live stream to join
    .live_stream_id(stream_id)?
    .replay_channel("aeron:udp?endpoint=localhost:0")?  // scratch channel for the replay
    .replay_stream_id(stream_id + 1)?
    .start_from_beginning()?            // replay from the start (or .start_from_live())
    .recording_id(recording_id)?        // which recording to replay
    .listener(MyListener { live_joined: live_joined.clone() })?
    .build()?;

// Drive it: replay runs, then it joins live. `ps.poll_fn()` drives its own archive
// client, so it needs nothing from `archive` (a control loop still calls
// `archive.do_work()` each cycle; see Duty Cycle). Check `has_failed()` each
// iteration (terminal failure) and stop once `is_live()`.
while !ps.is_live() {
    if ps.has_failed() {
        return Err(format!("persistent subscription failed: {:?}", ps.get_failure_reason()).into());
    }
    let _ = publication.offer(b"live"); // NotConnected/BackPressured are fine to skip in a demo
    ps.poll_fn(|buf, _hdr| { /* an assembled replayed or live message */ }, 100)?;
}

ps.close()?;

ps.poll_fn() runs the persistent subscription state machine and its Archive client. It does not need calls on your AeronArchive. See Duty cycle for what else to call each cycle. Loop on ps.is_live(), checking ps.has_failed() each iteration (reason via get_failure_reason()). The listener’s on_error covers non-terminal errors; on_live_left/on_live_joined may fire repeatedly as it falls back and rejoins.

A persistent subscription reassembles fragments internally. The C aeron_archive_persistent_subscription_poll routes each image through aeron_image_fragment_assembler_handler, so your handler receives whole messages directly. Poll for complete messages:

loop {
    // handler receives whole messages; no assembler needed
    ps.poll_fn(|buf, _hdr| { /* handle reassembled message */ }, 100)?;
}

If you prefer the shared assembler API (e.g. to reuse a collector across subscription types), AeronFragmentClosureAssembler works too. It polls the PS internally, so it advances the state machine and delivers messages in one call. Do not also call ps.poll_fn(…) separately, because that consumes the messages before the assembler sees them.

let mut assembler = AeronFragmentClosureAssembler::new()?;
let mut ctx = Collector::default();
loop {
    assembler.poll(&ps, &mut ctx, Collector::on_msg, 100)?;  // polls the PS internally
    if ctx.done { break; }
}

The examples and integration tests cover these cases:

  • examples/record_and_replay.rs: the typical workflow end to end, which records a stream, finds the recording and replays it
  • examples/persistent_subscription.rs: standalone demo (run with cargo run --release --features "static precompile" --example persistent_subscription)
  • examples/archive_error_handling.rs: error handlers on both contexts, recording signals, typed control-session errors (blocking calls return AeronArchiveError with e.code; archive.poll_for_error() drains unsolicited ones, always with Generic code), and reconnecting after the archive goes down
  • examples/persistent_subscription_failover.rs: failure modes, where the live stream dies (on_live_left) and the subscription rejoins it (on_live_joined) once the publisher resumes the same session where it stopped
  • examples/replay_merge.rs: late-joiner catch-up that replays recorded history, then merges onto the live MDC stream (AeronArchiveReplayMerge)
  • examples/recording_throughput.rs: recording throughput measurement (publish rate vs archiver catch-up) and list_recordings descriptor enumeration
  • examples/recording_replication.rs: archive-to-archive replication (archive.replicate), where a destination archive pulls a finished recording from a source archive and the copy is verified (port of RecordingReplicator)
  • persistent_subscription_tests::test_persistent_subscription_listener_live_joined (listener callbacks)
  • persistent_subscription_integration::test_end_to_end_persistent_subscription (recording, replay and live delivery)

§Benchmarks

See BENCHMARKS.md for latency and throughput benchmarks.


§Contributing

Report bugs and propose changes through GitHub Issues and pull requests. See CONTRIBUTING.md for the workflow and required checks. Contributions can cover API design, safety, Rust conventions and deployment examples.


§License

Licensed under either MIT License or Apache License 2.0 at your option.


§Acknowledgments

Special thanks to:

  • @mimran1980, a core low-latency developer at GSR and the original creator of Rusteron. Your work made this possible.
  • @bspeice for the original libaeron-sys
  • The Aeron community for the open protocol

§Features

  • static: When enabled, this feature statically links the Aeron C code. By default, the library uses dynamic linking to the Aeron C libraries.
  • backtrace: When enabled will log a backtrace for each AeronCError
  • extra-logging: When enabled will log when resource is created and destroyed. Useful if you’re seeing a segfault due to a resource being closed
  • log-c-bindings: When enabled will log every C binding call with arguments and return values. Useful for debugging FFI interactions
  • precompile: When enabled will use precompiled C code instead of requiring cmake and java to be installed

Modules§

bindings
testing

Macros§

cformat
format! for C strings: builds the formatted String and converts it to a CString in one visibly-named step.
skip_unless_java
Place at the top of any test that needs the Java archive. Skips the test (early-returns Ok(())) when java is not on PATH. Requires the test to return a Result<(), _>.

Structs§

Aeron
AeronAgentCloseFuncLogger
AeronAgentCloseFuncSlot
A callback you can replace without registering another handler.
AeronAgentDoWorkFuncLogger
AeronAgentDoWorkFuncSlot
A callback you can replace without registering another handler.
AeronAgentRunner
AeronAgentStartFuncLogger
AeronAgentStartFuncSlot
A callback you can replace without registering another handler.
AeronArchive
AeronArchiveAsyncConnect
AeronArchiveContext
AeronArchiveControlResponsePoller
AeronArchiveCredentialsChallengeSupplierFuncLogger
AeronArchiveCredentialsChallengeSupplierFuncSlot
A callback you can replace without registering another handler.
AeronArchiveCredentialsEncodedCredentialsSupplierFuncLogger
AeronArchiveCredentialsEncodedCredentialsSupplierFuncSlot
A callback you can replace without registering another handler.
AeronArchiveCredentialsFreeFuncLogger
AeronArchiveCredentialsFreeFuncSlot
A callback you can replace without registering another handler.
AeronArchiveCredentialsSupplier
AeronArchiveDelegatingInvokerFuncLogger
AeronArchiveDelegatingInvokerFuncSlot
A callback you can replace without registering another handler.
AeronArchiveEncodedCredentials
AeronArchiveError
A typed archive control-session error: the AeronArchiveErrorCode plus the full message from the archive.
AeronArchivePersistentSubscription
AeronArchivePersistentSubscriptionContext
AeronArchivePersistentSubscriptionListener
Listener for events from a persistent subscription.
AeronArchiveProxy
AeronArchiveRecordingDescriptor
Struct containing the details of a recording
AeronArchiveRecordingDescriptorConsumerFuncLogger
AeronArchiveRecordingDescriptorConsumerFuncSlot
A callback you can replace without registering another handler.
AeronArchiveRecordingDescriptorPoller
AeronArchiveRecordingPositionKeyLayout
AeronArchiveRecordingSignal
Struct containing the details of a recording signal.
AeronArchiveRecordingSignalConsumerFuncLogger
AeronArchiveRecordingSignalConsumerFuncSlot
A callback you can replace without registering another handler.
AeronArchiveRecordingSubscriptionDescriptor
Struct containing the details of a recording subscription
AeronArchiveRecordingSubscriptionDescriptorConsumerFuncLogger
AeronArchiveRecordingSubscriptionDescriptorConsumerFuncSlot
A callback you can replace without registering another handler.
AeronArchiveRecordingSubscriptionDescriptorPoller
AeronArchiveReplayMerge
AeronArchiveReplayParams
Struct containing the available replay parameters.
AeronArchiveReplayParamsBuilder
Fluent builder for AeronArchiveReplayParams, starting from aeron’s defaults (every field AERON_NULL_VALUE: replay from the recording start to its end, with the context-default file IO length and no bounding counter).
AeronArchiveReplicationParams
Struct containing the available replication parameters.
AeronArchiveReplicationParamsBuilder
Fluent builder for AeronArchiveReplicationParams, starting from aeron’s defaults: replicate into a new recording at the destination, no live merge, the context’s default replication channel, and no credentials.
AeronArchiveReplicationParamsOwned
AeronArchiveReplicationParams plus the string storage its C struct points into.
AeronAsyncAddCounter
AeronAsyncAddExclusivePublication
AeronAsyncAddPublication
AeronAsyncAddSubscription
AeronAsyncDestination
AeronAsyncDestinationById
AeronAsyncGetNextAvailableSessionId
AeronAvailableCounterLogger
AeronAvailableCounterPair
AeronAvailableCounterSlot
A callback you can replace without registering another handler.
AeronAvailableImageLogger
AeronAvailableImageSlot
A callback you can replace without registering another handler.
AeronBlockHandlerLogger
AeronBlockHandlerSlot
A callback you can replace without registering another handler.
AeronBufferClaim
Structure used to hold information for a try_claim function call.
AeronCError
Aeron C API error: code + optional message.
AeronClaim
Zero-copy claim on a publication’s term buffer with a RAII commit-or-abort lifecycle.
AeronClientRegisteringResource
AeronCloseClientLogger
AeronCloseClientPair
AeronCloseClientSlot
A callback you can replace without registering another handler.
AeronCnc
AeronCncConstants
AeronCncMetadata
AeronContext
AeronControlledFragmentAssembler
AeronControlledFragmentClosureAssembler
AeronControlledFragmentHandlerLogger
AeronControlledFragmentHandlerSlot
A callback you can replace without registering another handler.
AeronCounter
AeronCounterConstants
Configuration for a counter that does not change during its lifetime.
AeronCounterMetadataDescriptor
AeronCounterValueDescriptor
AeronCountersReader
AeronCountersReaderBuffers
AeronCountersReaderForeachCounterFuncLogger
AeronCountersReaderForeachCounterFuncSlot
A callback you can replace without registering another handler.
AeronDataHeader
AeronDataHeaderAsLongs
AeronErrorHandlerLogger
AeronErrorHandlerSlot
A callback you can replace without registering another handler.
AeronErrorHeader
AeronErrorLogReaderFuncLogger
AeronErrorLogReaderFuncSlot
A callback you can replace without registering another handler.
AeronErrorLogger
Production error handler that routes Aeron async errors through the Rust log facade at error level with a concise format. This is the recommended default for AeronContext::set_error_handler.
AeronExclusivePublication
AeronFprintfHandlerLogger
AeronFprintfHandlerSlot
A callback you can replace without registering another handler.
AeronFragmentAssembler
AeronFragmentClosureAssembler
AeronFragmentHandlerLogger
AeronFragmentHandlerSlot
A callback you can replace without registering another handler.
AeronFrameHeader
AeronHeader
AeronHeaderValues
AeronHeaderValuesFrame
AeronIdleStrategy
AeronIdleStrategyFuncLogger
AeronIdleStrategyFuncSlot
A callback you can replace without registering another handler.
AeronImage
AeronImageConstants
Configuration for an image that does not change during it’s lifetime.
AeronImageControlledFragmentAssembler
AeronImageFragmentAssembler
AeronIovec
AeronIpcChannelParams
AeronLogBuffer
AeronLogbufferMetadata
AeronLossReporter
AeronLossReporterEntry
AeronLossReporterReadEntryFuncLogger
AeronLossReporterReadEntryFuncSlot
A callback you can replace without registering another handler.
AeronMappedBuffer
AeronMappedFile
AeronMappedRawLog
AeronNakHeader
AeronNewPublicationLogger
AeronNewPublicationSlot
A callback you can replace without registering another handler.
AeronNewSubscriptionLogger
AeronNewSubscriptionSlot
A callback you can replace without registering another handler.
AeronNotificationLogger
AeronNotificationSlot
A callback you can replace without registering another handler.
AeronOptionHeader
AeronPerThreadError
AeronPublication
AeronPublicationConstants
Configuration for a publication that does not change during it’s lifetime.
AeronPublicationErrorFrameHandlerLogger
AeronPublicationErrorFrameHandlerSlot
A callback you can replace without registering another handler.
AeronPublicationErrorValues
AeronReservedValueSupplierLogger
AeronReservedValueSupplierSlot
A callback you can replace without registering another handler.
AeronResolutionHeader
AeronResolutionHeaderIpv4
AeronResolutionHeaderIpv6
AeronResponseSetupHeader
AeronRttmHeader
AeronSetupHeader
AeronStatusMessageHeader
AeronStatusMessageOptionalHeader
AeronStatusTracker
Status transition tracker that emits only when the observed AeronStatus differs from the previously recorded state.
AeronStrToPtrHashMap
AeronStrToPtrHashMapForEachFuncLogger
AeronStrToPtrHashMapForEachFuncSlot
A callback you can replace without registering another handler.
AeronStrToPtrHashMapKey
AeronSubscription
AeronSubscriptionConstants
AeronUdpChannelParams
AeronUnavailableCounterLogger
AeronUnavailableCounterPair
AeronUnavailableCounterSlot
A callback you can replace without registering another handler.
AeronUnavailableImageLogger
AeronUnavailableImageSlot
A callback you can replace without registering another handler.
AeronUri
AeronUriParam
AeronUriParams
AeronUriParseCallbackLogger
AeronUriParseCallbackSlot
A callback you can replace without registering another handler.
AeronUriStringBuilder
BackoffIdleStrategy
Adaptive backoff: spin a few times, then yield a few times, then sleep with an exponentially growing park up to a max. A good general-purpose strategy. (Aeron BackoffIdleStrategy.)
BusySpinIdleStrategy
Spin with a CPU pause hint. Lowest latency, pins a core. (Aeron BusySpinIdleStrategy.)
CallbackSlot
Lets you replace a callback without registering another handler with Aeron.
ChannelUri
Represents the Aeron URI parser and handler.
FnMutControlledMessageHandler
FnMutMessageHandler
Handler
A reference-counted callback that C stores and calls later.
Handlers
Utility method for setting empty handlers
ManagedCResource
Owns a C resource and calls its cleanup closure when the last handle drops.
NoHandler
Type-level “no callback” sentinel.
NoOpIdleStrategy
No-op. Never yields the core. (Aeron NoOpIdleStrategy.)
PersistentSubscriptionBuilder
Builder for configuring and creating a persistent subscription. This provides a fluent interface for setting up a persistent subscription with proper CString handling.
RecordingDescriptor
Recording descriptor for owned recording data
RecordingPos
Ref
A wrapper around a C object that belongs to the value it came from, such as the context returned by archive.get_archive_context()
SleepingIdleStrategy
Sleep for a fixed duration when idle. (Aeron SleepingIdleStrategy.)
YieldingIdleStrategy
Yield the OS thread when idle. Lower CPU than busy-spin, slightly higher latency. (Aeron YieldingIdleStrategy.)

Enums§

AeronArchiveErrorCode
Archive control-response error codes (io.aeron.archive.client.ArchiveException).
AeronErrorType
AeronIdleStrategyKind
Aeron’s named idle strategies, as accepted by the context / media-driver set_*_idle_strategy options (the C aeron_idle_strategy_load symbol table).
AeronOfferError
Typed error for offer / try_claim on a publication.
AeronStatus
High-level connection state of a publication or subscription.
AeronSystemCounterType
CResource
ControlMode
Enum for control modes.
Media
Enum for media types.

Constants§

AERON_DIR_PROP_NAME
AERON_IPC_MEDIA
AERON_UDP_MEDIA
DRIVER_TIMEOUT_MS_DEFAULT
MAX_OFFER_PARTS
Max buffer parts accepted by AeronPublication::offer_parts / AeronExclusivePublication::offer_parts. The aeron_iovec_t array is built on the stack, so it has a fixed capacity. Use the raw offerv with your own iovec array for larger gathers.
PERSISTENT_SUBSCRIPTION_FROM_LIVE
Sentinel for PersistentSubscriptionBuilder::start_position: skip replay and join the live stream immediately. Maps to Aeron’s AERON_ARCHIVE_PERSISTENT_SUBSCRIPTION_FROM_LIVE.
PERSISTENT_SUBSCRIPTION_FROM_START
Sentinel for PersistentSubscriptionBuilder::start_position: replay from the beginning of the recording. Maps to Aeron’s AERON_ARCHIVE_PERSISTENT_SUBSCRIPTION_FROM_START.
PUBLICATION_ADMIN_ACTION
PUBLICATION_BACK_PRESSURED
PUBLICATION_CLOSED
PUBLICATION_ERROR
PUBLICATION_MAX_POSITION_EXCEEDED
PUBLICATION_NOT_CONNECTED
Result codes returned by AeronPublication::offer / try_claim (Aeron aeronc.h). A positive value is the resulting log position; the negatives classify the failure.
SOURCE_LOCATION_LOCAL
SOURCE_LOCATION_REMOTE
SPY_PREFIX
TAG_PREFIX

Statics§

AERON_IPC_STREAM

Traits§

AeronAgentCloseFuncCallback
(note wrapper arguments are borrowed for the call only; copy out any fields, including strings, you use afterwards)
AeronAgentDoWorkFuncCallback
(note wrapper arguments are borrowed for the call only; copy out any fields, including strings, you use afterwards)
AeronAgentStartFuncCallback
(note wrapper arguments are borrowed for the call only; copy out any fields, including strings, you use afterwards)
AeronArchiveCredentialsChallengeSupplierFuncCallback
Callback to return encoded credentials given a specific encoded challenge.
AeronArchiveCredentialsEncodedCredentialsSupplierFuncCallback
Callback to return encoded credentials.
AeronArchiveCredentialsFreeFuncCallback
Callback to return encoded credentials so they may be reused or freed.
AeronArchiveDelegatingInvokerFuncCallback
Callback to allow execution of a delegating invoker to be run.
AeronArchiveRecordingDescriptorConsumerFuncCallback
Callback to return recording descriptors.
AeronArchiveRecordingSignalConsumerFuncCallback
Callback to return recording signals.
AeronArchiveRecordingSubscriptionDescriptorConsumerFuncCallback
Callback to return recording subscription descriptors.
AeronAvailableCounterCallback
Function called by aeron_client_t to deliver notifications that a counter has been added to the driver.
AeronAvailableImageCallback
Function called by aeron_client_t to deliver notifications that an aeron_image_t was added.
AeronBlockHandlerCallback
Callback for handling a block of messages being read from a log.
AeronCloseClientCallback
Function called by aeron_client_t to deliver notifications that the client is closing.
AeronControlledFragmentHandlerCallback
Callback for handling fragments of data being read from a log.
AeronCountersReaderForeachCounterFuncCallback
Function called by aeron_counters_reader_foreach_counter for each counter in the aeron_counters_reader_t.
AeronErrorHandlerCallback
The error handler to be called when an error occurs.
AeronErrorLogReaderFuncCallback
(note wrapper arguments are borrowed for the call only; copy out any fields, including strings, you use afterwards)
AeronFprintfHandlerCallback
(note wrapper arguments are borrowed for the call only; copy out any fields, including strings, you use afterwards)
AeronFragmentHandlerCallback
Callback for handling fragments of data being read from a log.
AeronIdleStrategyFuncCallback
(note wrapper arguments are borrowed for the call only; copy out any fields, including strings, you use afterwards)
AeronLossReporterReadEntryFuncCallback
(note wrapper arguments are borrowed for the call only; copy out any fields, including strings, you use afterwards)
AeronNewPublicationCallback
Function called by aeron_client_t to deliver notification that the media driver has added an aeron_publication_t or aeron_exclusive_publication_t successfully.
AeronNewSubscriptionCallback
Function called by aeron_client_t to deliver notification that the media driver has added an aeron_subscription_t successfully.
AeronNotificationCallback
Generalised notification callback.
AeronPublicationErrorFrameHandlerCallback
The error frame handler to be called when the driver notifies the client about an error frame being received. The data passed to this callback will only be valid for the lifetime of the callback. The user should use aeron_publication_error_values_copy if they require the data to live longer than that.
AeronReservedValueSupplierCallback
Function called when filling in the reserved value field of a message.
AeronStrToPtrHashMapForEachFuncCallback
(note wrapper arguments are borrowed for the call only; copy out any fields, including strings, you use afterwards)
AeronUnavailableCounterCallback
Function called by aeron_client_t to deliver notifications that a counter has been removed from the driver.
AeronUnavailableImageCallback
Function called by aeron_client_t to deliver notifications that an aeron_image_t has been removed from use and should not be used any longer.
AeronUriParseCallbackCallback
(note wrapper arguments are borrowed for the call only; copy out any fields, including strings, you use afterwards)
ControlledFragmentAssemblable
A poll target whose raw fragments can be reassembled by AeronControlledFragmentAssembler.
FragmentAssemblable
A poll target whose raw fragments can be reassembled by AeronFragmentAssembler. Implemented for AeronSubscription here and for archive types in rusteron-archive.
IdleStrategy
Back off a poll loop when the last cycle did no work. Mirrors Aeron’s IdleStrategy: idle(work_count) returns immediately when work_count > 0, otherwise spins / yields / sleeps depending on the implementation.
IntoCString
PersistentSubscriptionListener
Trait for persistent subscription event listeners. This provides a safe Rust alternative to using raw C function pointers.

Functions§

find_unused_udp_port
is_udp_port_available
persistent_subscription_builder
Returns a builder for configuring a persistent subscription context
validate_endpoint_for_aeron_udp
Validate a UDP channel URI endpoint (host:port) for use with Aeron.

Type Aliases§

CleanupBox
RcOrArc
Reference-counting smart pointer: Rc by default, Arc under the multi-threaded feature. Swapping is transparent. RcOrArc::new, .clone() and strong_count all work on both.
RefCellOrMutex
SourceLocation