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 Sample
— no copy, no serialization, no service discovery layer.
Supported platforms: Linux, macOS, Windows.
§Quick Start
use crossbar::*;
// Publisher
let mut pub_ = Publisher::create("prices", Config::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::Config;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§
- BusSubscriber
- A subscriber that reads from a
PodBusring via shared memory. - Channel
- Bidirectional shared-memory channel.
- Discovered
Topic - A discovered topic from the global registry.
- Loan
- A mutable view into a pool block in shared memory.
- Pinned
Loan - Mutable view into a pinned block in shared memory.
- Pinned
Sample - Near-zero-overhead read reference to a pinned block in shared memory.
- PodBus
- SPMC broadcast ring for
Podtypes, backed by shared memory. - Publisher
- O(1) zero-copy publisher over shared memory.
- Registry
- Global topic registry for service discovery.
- Sample
- Safe zero-copy reference to a published sample in shared memory.
- Stream
- A subscription to a single topic on a pool-backed pub/sub region.
- Subscriber
- O(1) zero-copy subscriber for pool-backed pub/sub.
- Topic
- Handle returned by
super::shm::Publisher::register. Identifies a topic for use withsuper::shm::Publisher::loan. - Typed
Loan - Typed mutable loan of a
T: Podvalue in shared memory. - Typed
Sample - Typed zero-copy reference to a
T: Podvalue in shared memory.
Traits§
- Pod
- Plain-old-data types where every bit pattern is valid.
Functions§
- discover
- Discover topics matching a URI pattern.
Type Aliases§
- IpcError
Deprecated - Renamed to
error::Error. - Pinned
Guard Deprecated - Renamed to
PinnedSample. - PodBus
Subscriber Deprecated - Renamed to
BusSubscriber. - PubSub
Config Deprecated - Renamed to
Config. - Sample
Guard Deprecated - Renamed to
Sample. - ShmChannel
Deprecated - Renamed to
Channel. - ShmLoan
Deprecated - Renamed to
Loan. - ShmPublisher
Deprecated - Renamed to
Publisher. - ShmSubscriber
Deprecated - Renamed to
Subscriber. - Subscription
Deprecated - Renamed to
Stream. - Topic
Handle Deprecated - Renamed to
Topic. - Typed
Sample Guard Deprecated - Renamed to
TypedSample. - Typed
ShmLoan Deprecated - Renamed to
TypedLoan.