Expand description
§crossbar
Zero-copy pub/sub over shared memory. URI-addressed. O(1) transfer at any payload size.
Transfers an 8-byte descriptor through a lock-free ring — O(1) regardless
of payload. Subscribers read directly from shared memory via SampleGuard
— no copy, no serialization, no service discovery layer.
Supported platforms: Linux, macOS, Windows.
§Quick Start
use crossbar::*;
// Publisher
let mut pub_ = ShmPublisher::create("prices", PubSubConfig::default()).unwrap();
let topic = pub_.register("/tick/AAPL").unwrap();
let mut loan = pub_.loan(&topic).unwrap();
loan.set_data(b"hello").unwrap();
loan.publish(); // O(1) — writes 8 bytes to ringRe-exports§
pub use protocol::PubSubConfig;pub use protocol::Region;pub use wait::WaitStrategy;
Modules§
- error
- Error types for shared-memory pub/sub operations.
- protocol
- Core protocol types and layout constants for crossbar pub/sub.
- wait
- Wait strategies for blocking receive operations.
Structs§
- Pinned
Guard - Near-zero-overhead read reference to a pinned block in shared memory.
- Pinned
Loan - Mutable view into a pinned block in shared memory.
- Sample
Guard - Safe zero-copy reference to a published sample in shared memory.
- ShmChannel
- Bidirectional shared-memory channel.
- ShmLoan
- A mutable view into a pool block in shared memory.
- ShmPublisher
- O(1) zero-copy publisher over shared memory.
- ShmSubscriber
- O(1) zero-copy subscriber for pool-backed pub/sub.
- Subscription
- A subscription to a single topic on a pool-backed pub/sub region.
- Topic
Handle - Handle returned by
super::shm::ShmPublisher::register. Identifies a topic for use withsuper::shm::ShmPublisher::loan. - Typed
Sample Guard - Typed zero-copy reference to a
T: Podvalue in shared memory. - Typed
ShmLoan - Typed mutable loan of a
T: Podvalue in shared memory.
Traits§
- Pod
- Plain-old-data types where every bit pattern is valid.