Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
rusteron-rb
rusteron-rb is a core component of the rusteron project, providing ring buffer and broadcast functionalities to interact with the Aeron messaging system in a Rust environment. It enables Rust developers to leverage Aeron's high-performance, low-latency communication protocols.
Overview
The rusteron-rb module acts as a Rust wrapper around the Aeron C ring buffer API. It offers functions for establishing connections, transmitting and receiving messages, and broadcasting data streams, allowing seamless communication between distributed applications. Since it is built on top of Aeron's C bindings, this library operates in an unsafe
context, requiring extra care from developers to ensure correctness.
Note: Since this module leverages Aeron C bindings, it is inherently unsafe and should be used with caution. Incorrect usage can lead to undefined behavior, such as segmentation faults.
Features
- Broadcast Receiver: Receive messages from Aeron broadcast channels using
AeronBroadcastReceiver
. - Broadcast Transmitter: Send messages to Aeron broadcast channels using
AeronBroadcastTransmitter
. - MPSC Ring Buffer: Multi-producer, single-consumer ring buffer implementation using
AeronMpscRb
. - SPSC Ring Buffer: Single-producer, single-consumer ring buffer implementation using
AeronSpscRb
.
Usage Example
Single Producer, Single Consumer Ring Buffer
This example demonstrates how to use the AeronSpscRb
to create a simple single producer, single consumer ring buffer.
use *;
use Error;
Multi-Producer, Single Consumer Ring Buffer
The following example demonstrates how to use the AeronMpscRb
for a multi-producer, single consumer scenario, enabling multiple producers to write to the same ring buffer while a single consumer reads from it.
use *;
use Error;
Broadcast Transmitter and Receiver
This example demonstrates how to set up a broadcast transmitter and receiver. The transmitter sends messages that are then received by the receiver, illustrating a simple broadcast communication scenario.
use *;
use Error;
Installation
Add the following to your Cargo.toml
file to include rusteron-rb:
dynamic lib
[]
= "0.1"
static lib
[]
= { = "0.1", = ["static"] }
Ensure you have also set up the necessary Aeron C libraries required by rusteron-rb.
Safety Considerations
Since rusteron-rb relies on Aeron C bindings, it involves unsafe
Rust code. Users must ensure:
- Resources are properly managed.
- Proper synchronization when accessing shared data in a multi-threaded environment.
Failing to uphold these safety measures can lead to crashes or undefined behavior.
Contributing
Contributions are welcome! Please feel free to open issues, submit pull requests, or suggest new features. We're particularly interested in:
- Feedback on API usability.
- Bug reports and feature requests.
- Documentation improvements.
If you wish to contribute, refer to our contributing guidelines.
License
This project is dual-licensed under either the MIT License or the Apache License 2.0. You may choose which one to use.
Links
Feel free to reach out with any questions or suggestions via GitHub Issues!