Expand description
§rusteron-media-driver
rusteron-media-driver is a Rust interface to the Aeron Media Driver, responsible for managing low-latency messaging infrastructure between producers and consumers. It’s part of the Rusteron project and provides both standalone and embedded driver support.
For production deployments, we recommend using the Aeron Java or C media driver.
The embedded version provided here is best suited for integration tests or lightweight environments.
§Installation
To use rusteron-media-driver
, add the appropriate dependency to your Cargo.toml
:
Dynamic
[dependencies]
rusteron-media-driver = "0.1"
Static
[dependencies]
rusteron-media-driver = { version = "0.1", features = ["static"] }
Static with precompiled C libs (macOS only)
[dependencies]
rusteron-media-driver = { version = "0.1", features = ["static", "precompile"] }
Ensure the Aeron C libraries are properly installed and available on your system.
§Usage Examples
Standard Media Driver
// Launches a standalone Aeron Media Driver
use rusteron_media_driver::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let aeron_context = AeronDriverContext::new()?;
aeron_context.set_dir(&"target/test".into_c_string())?;
let aeron_driver = AeronDriver::new(&aeron_context)?;
aeron_driver.start(false)?;
println!("Aeron Media Driver started");
Ok(())
}
Embedded Media Driver
// Embeds the media driver directly into the current process
use rusteron_media_driver::*;
use std::sync::{Arc, atomic::{AtomicBool, Ordering}};
use std::thread;
use std::time::Duration;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let media_driver_ctx = AeronDriverContext::new()?;
let (stop, driver_handle) = AeronDriver::launch_embedded(media_driver_ctx.clone(), false);
let ctx = AeronContext::new()?;
ctx.set_dir(&media_driver_ctx.get_dir().into_c_string())?;
thread::sleep(Duration::from_secs(3)); // Simulated workload
stop.store(true, Ordering::SeqCst);
driver_handle.join().expect("Failed to join driver thread");
println!("Embedded Aeron Media Driver stopped");
Ok(())
}
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 AeronCErrorextra-logging
- When enabled will log when resource is created and destroyed. useful if your seeing a segfault due to a resource being closedprecompile
- When enabled will use precompiled c code instead of requiring cmake and java to me installed
Modules§
Structs§
- Addrinfo
- Aeron
- Aeron
Agent Close Func Logger - Aeron
Agent DoWork Func Logger - Aeron
Agent Runner - Aeron
Agent Start Func Logger - Aeron
Async AddCounter - Aeron
Async AddExclusive Publication - Aeron
Async AddPublication - Aeron
Async AddSubscription - Aeron
Async Destination - Aeron
Async Destination ById - Aeron
Atomic Counter - Aeron
Available Counter Logger - Aeron
Available Counter Pair - Aeron
Available Image Logger - Aeron
Block Handler Logger - Aeron
Blocking Linked Queue - Aeron
Broadcast Descriptor - Aeron
Broadcast Record Descriptor - Aeron
Broadcast Transmitter - Aeron
Buffer Claim - Structure used to hold information for a try_claim function call.
- AeronC
Error - Represents an Aeron-specific error with a code and an optional message.
- Aeron
Channel Endpoint Status KeyLayout - Aeron
Client - Aeron
Client Registering Resource - Aeron
Client Timeout - Aeron
Clock Cache - Aeron
Close Client Logger - Aeron
Close Client Pair - Aeron
Cnc - Aeron
CncConstants - Aeron
CncMetadata - Aeron
Congestion Control Strategy - Aeron
Congestion Control Strategy Initial Window Length Func Logger - Aeron
Congestion Control Strategy MaxWindow Length Func Logger - Aeron
Congestion Control Strategy Rttm Func Logger - Aeron
Congestion Control Strategy Rttm Sent Func Logger - Aeron
Congestion Control Strategy Should Measure RttFunc Logger - Aeron
Context - Aeron
Controlled Fragment Assembler - Aeron
Controlled Fragment Closure Assembler - Aeron
Controlled Fragment Handler Logger - Aeron
Correlated Command - Aeron
Counter - Aeron
Counter Command - Aeron
Counter Constants - Configuration for a counter that does not change during it’s lifetime.
- Aeron
Counter Link - Aeron
Counter Metadata Descriptor - Aeron
Counter Update - Aeron
Counter Value Descriptor - Aeron
Counters Manager - Aeron
Counters Reader - Aeron
Counters Reader Buffers - Aeron
Counters Reader Foreach Counter Func Logger - Aeron
Counters Reader Foreach Metadata Func Logger - Aeron
Data Header - Aeron
Data Header AsLongs - Aeron
Data Packet Dispatcher - Aeron
Data Packet Dispatcher Stream Interest - Aeron
Deque - Aeron
Destination ById Command - Aeron
Destination Command - Aeron
Distinct Error Log - Aeron
Distinct Error LogObservation List - Aeron
Distinct Observation - Aeron
DlLoaded Libs State - Aeron
Driver - Aeron
Driver Conductor - Aeron
Driver Conductor Proxy - Aeron
Driver Context - Aeron
Driver Context Bindings Clientd Entry - Aeron
Driver Managed Resource - Aeron
Driver Receiver - Aeron
Driver Receiver Image Entry - Aeron
Driver Receiver Pending Setup Entry - Aeron
Driver Receiver Proxy - Aeron
Driver Sender - Aeron
Driver Sender Network Publication Entry - Aeron
Driver Sender Proxy - Aeron
Driver Termination Hook Func Logger - Aeron
Driver Termination Validator Func Logger - Aeron
Driver UriPublication Params - Aeron
Driver UriSubscription Params - Aeron
Duty Cycle Stall Tracker - Aeron
Duty Cycle Tracker - Aeron
Duty Cycle Tracker Measure AndUpdate Func Logger - Aeron
Duty Cycle Tracker Update Func Logger - Aeron
EndOf Life Resource - Aeron
EndOf Life Resource Free Logger - Aeron
Error - Aeron
Error Handler Logger - Aeron
Error LogEntry - Aeron
Error LogReader Func Logger - Aeron
Error Logger - Aeron
Error Response - Aeron
Exclusive Publication - Aeron
Executor Execution Complete Func Logger - Aeron
Feedback Delay Generator State - Aeron
Flow Control MaxOptions - Aeron
Flow Control Strategy - Aeron
Flow Control Strategy Error Func Logger - Aeron
Flow Control Strategy Idle Func Logger - Aeron
Flow Control Strategy MaxRetransmission Length Func Logger - Aeron
Flow Control Strategy Setup Func Logger - Aeron
Flow Control Strategy SmFunc Logger - Aeron
Flow Control Strategy Supplier Func Table Entry - Aeron
Flow Control Strategy Trigger Send Setup Func Logger - Aeron
Flow Control Tagged Options - Aeron
Fragment Assembler - Aeron
Fragment Closure Assembler - Aeron
Fragment Handler Logger - Aeron
Frame Header - Aeron
Header - Aeron
Header Values - Aeron
Header Values Frame - Aeron
Heartbeat Timestamp KeyLayout - Aeron
Idle Strategy - Aeron
Idle Strategy Func Logger - Aeron
Ifaddr Func Logger - Aeron
Image - Aeron
Image Buffers Ready - Aeron
Image Constants - Configuration for an image that does not change during it’s lifetime.
- Aeron
Image Controlled Fragment Assembler - Aeron
Image Fragment Assembler - Aeron
Image Message - Aeron
Int64 Counter Map - Aeron
Int64 Counter MapFor Each Func Logger - Aeron
Int64 Counter MapPredicate Func Logger - Aeron
Int64 ToPtr Hash Map - Aeron
Int64 ToTagged PtrEntry - Aeron
Int64 ToTagged PtrHash Map - Aeron
Iovec - Aeron
IpcChannel Params - Aeron
IpcPublication - Aeron
IpcPublication Entry - Aeron
Linger Resource Entry - Aeron
Linked Queue - Aeron
Linked Queue Node - Aeron
Local Sockaddr KeyLayout - Aeron
LogBuffer - Aeron
Logbuffer Metadata - Aeron
Loss Detector - Aeron
Loss Detector Gap - Aeron
Loss Reporter - Aeron
Loss Reporter Entry - Aeron
Loss Reporter Read Entry Func Logger - Aeron
Mapped Buffer - Aeron
Mapped File - Aeron
Mapped RawLog - Aeron
Mpsc Concurrent Array Queue - Aeron
Mpsc Rb - Aeron
NakHeader - Aeron
Network Publication - Aeron
Network Publication Entry - Aeron
NewPublication Logger - Aeron
NewSubscription Logger - Aeron
Notification Logger - Aeron
Operation Succeeded - Aeron
Option Header - Aeron
Parsed Address - Aeron
Parsed Interface - Aeron
PerThread Error - Aeron
Port Manager - Aeron
Port Manager Free Managed Port Func Logger - Aeron
Port Manager GetManaged Port Func Logger - Aeron
Position - Aeron
Publication - Aeron
Publication Buffers Ready - Aeron
Publication Command - Aeron
Publication Constants - Configuration for a publication that does not change during it’s lifetime.
- Aeron
Publication Error - Aeron
Publication Error Frame Handler Logger - Aeron
Publication Error Values - Aeron
Publication Image - Aeron
Publication Image Connection - Aeron
Publication Image Entry - Aeron
Publication Link - Aeron
RbControlled Handler Logger - Aeron
RbDescriptor - Aeron
RbHandler Logger - Aeron
RbRecord Descriptor - Aeron
Receive Channel Endpoint - Aeron
Receive Channel Endpoint Entry - Aeron
Receive Destination - Aeron
Receive Destination Entry - Aeron
Reject Image Command - Aeron
Remove Counter Command - Aeron
Remove Publication Command - Aeron
Remove Subscription Command - Aeron
Reserved Value Supplier Logger - Aeron
Resolution Header - Aeron
Resolution Header Ipv4 - Aeron
Resolution Header Ipv6 - Aeron
Response Setup Header - Aeron
Retransmit Action - Aeron
Retransmit Handler - Aeron
Retransmit Handler Resend Func Logger - Aeron
Rttm Header - Aeron
Send Channel Endpoint - Aeron
Send Channel Endpoint Entry - Aeron
Setup Header - Aeron
Spsc Concurrent Array Queue - Aeron
Static Counter Command - Aeron
Static Counter Response - Aeron
Status Message Header - Aeron
Status Message Optional Header - Aeron
StrTo PtrHash Map - Aeron
StrTo PtrHash MapKey - Aeron
Stream Position Counter KeyLayout - Aeron
Subscribable - Aeron
Subscribable List Entry - Aeron
Subscription - Aeron
Subscription Command - Aeron
Subscription Constants - Aeron
Subscription Link - Aeron
Subscription Ready - Aeron
System Counter - Aeron
System Counters - Aeron
Term GapScanner GapDetected Func Logger - Aeron
Terminate Driver Command - Aeron
Tetherable Position - Aeron
UdpChannel - Aeron
UdpChannel Async Parse - Aeron
UdpChannel Data Paths - Aeron
UdpChannel Incoming Interceptor - Aeron
UdpChannel Interceptor Bindings - Aeron
UdpChannel Outgoing Interceptor - Aeron
UdpChannel Params - Aeron
UdpDestination Entry - Aeron
UdpDestination Tracker - Aeron
Unavailable Counter Logger - Aeron
Unavailable Counter Pair - Aeron
Unavailable Image Logger - Aeron
Uri - Aeron
UriHostname Resolver Func Logger - Aeron
UriParam - Aeron
UriParams - Aeron
UriParse Callback Logger - Aeron
UriString Builder - Aeron
Wildcard Port Manager - Channel
Uri - Represents the Aeron URI parser and handler.
- Darwin
Pthread Handler Rec - FnMut
Controlled Message Handler - FnMut
Message Handler - Handler
- Handler
- Handlers
- Utility method for setting empty handlers
- Ifaddrs
- In6Addr
- Iovec
- ManagedC
Resource - A custom struct for managing C resources with automatic cleanup.
- Mmsghdr
- Msghdr
- Opaque
Pthread - Opaque
Pthread Attr - Opaque
Pthread Cond - Opaque
Pthread Mutex - Pollfd
- Sockaddr
- Sockaddr
Storage - Timespec
Enums§
- Aeron
Error Type - Aeron
System Counter Type - CResource
- Control
Mode - Enum for control modes.
- Media
- Enum for media types.
Constants§
Statics§
Traits§
- Aeron
Agent Close Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Agent DoWork Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Agent Start Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Available Counter Callback - Function called by aeron_client_t to deliver notifications that a counter has been added to the driver.
- Aeron
Available Image Callback - Function called by aeron_client_t to deliver notifications that an aeron_image_t was added.
- Aeron
Block Handler Callback - Callback for handling a block of messages being read from a log.
- Aeron
Close Client Callback - Function called by aeron_client_t to deliver notifications that the client is closing.
- Aeron
Congestion Control Strategy Initial Window Length Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Congestion Control Strategy MaxWindow Length Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Congestion Control Strategy Rttm Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Congestion Control Strategy Rttm Sent Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Congestion Control Strategy Should Measure RttFunc Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Controlled Fragment Handler Callback - Callback for handling fragments of data being read from a log.
- Aeron
Counters Reader Foreach Counter Func Callback - Function called by aeron_counters_reader_foreach_counter for each counter in the aeron_counters_reader_t.
- Aeron
Counters Reader Foreach Metadata Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Driver Termination Hook Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Driver Termination Validator Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Duty Cycle Tracker Measure AndUpdate Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Duty Cycle Tracker Update Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
EndOf Life Resource Free Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Error Handler Callback - The error handler to be called when an error occurs.
- Aeron
Error LogReader Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Executor Execution Complete Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Flow Control Strategy Error Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Flow Control Strategy Idle Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Flow Control Strategy MaxRetransmission Length Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Flow Control Strategy Setup Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Flow Control Strategy SmFunc Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Flow Control Strategy Trigger Send Setup Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Fragment Handler Callback - Callback for handling fragments of data being read from a log.
- Aeron
Idle Strategy Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Ifaddr Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Int64 Counter MapFor Each Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Int64 Counter MapPredicate Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Loss Reporter Read Entry Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
NewPublication Callback - 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.
- Aeron
NewSubscription Callback - Function called by aeron_client_t to deliver notification that the media driver has added an aeron_subscription_t successfully.
- Aeron
Notification Callback - Generalised notification callback.
- Aeron
Port Manager Free Managed Port Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Port Manager GetManaged Port Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Publication Error Frame Handler Callback - 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. - Aeron
RbControlled Handler Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
RbHandler Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Reserved Value Supplier Callback - Function called when filling in the reserved value field of a message.
- Aeron
Retransmit Handler Resend Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Term GapScanner GapDetected Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
Unavailable Counter Callback - Function called by aeron_client_t to deliver notifications that a counter has been removed from the driver.
- Aeron
Unavailable Image Callback - 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.
- Aeron
UriHostname Resolver Func Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- Aeron
UriParse Callback Callback - (note you must copy any arguments that you use afterwards even those with static lifetimes)
- IntoC
String