pub struct MarketDataBus { /* private fields */ }Expand description
Implementations§
Source§impl MarketDataBus
impl MarketDataBus
Sourcepub fn new() -> MarketDataBus
pub fn new() -> MarketDataBus
Create a new bus with the default capacity.
Sourcepub fn with_capacity(capacity: usize) -> MarketDataBus
pub fn with_capacity(capacity: usize) -> MarketDataBus
Create a new bus with an explicit channel capacity.
Sourcepub fn subscribe(&self) -> Receiver<MarketDataEvent>
pub fn subscribe(&self) -> Receiver<MarketDataEvent>
Subscribe a new consumer. The returned receiver sees all events published after this call.
Sourcepub fn publish(&self, event: MarketDataEvent) -> usize
pub fn publish(&self, event: MarketDataEvent) -> usize
Publish an event. Returns the number of active subscribers that received it.
If the send fails (no subscribers) the event is silently dropped — this is the correct behaviour for a broadcast bus where the producer doesn’t care whether anyone is listening.
Sourcepub fn subscriber_count(&self) -> usize
pub fn subscriber_count(&self) -> usize
Current number of subscribers.
Trait Implementations§
Source§impl Clone for MarketDataBus
impl Clone for MarketDataBus
Source§fn clone(&self) -> MarketDataBus
fn clone(&self) -> MarketDataBus
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MarketDataBus
impl Debug for MarketDataBus
Source§impl Default for MarketDataBus
impl Default for MarketDataBus
Source§fn default() -> MarketDataBus
fn default() -> MarketDataBus
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MarketDataBus
impl RefUnwindSafe for MarketDataBus
impl Send for MarketDataBus
impl Sync for MarketDataBus
impl Unpin for MarketDataBus
impl UnsafeUnpin for MarketDataBus
impl UnwindSafe for MarketDataBus
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more