pub struct CommandBus { /* private fields */ }Expand description
Bounded, non-blocking fan-out of commands received by the daemon.
Every omni listen connection gets its own queue. A stalled subscriber can
drop its own events, but can never delay OS injection or other subscribers.
Implementations§
Source§impl CommandBus
impl CommandBus
pub fn new() -> Self
Sourcepub fn publish(&self, cmd: &InjectionCommand)
pub fn publish(&self, cmd: &InjectionCommand)
Publish without blocking the command/injection path. Full queues drop the newest event; disconnected subscribers are removed.
Sourcepub fn publish_event(&self, event: &SemanticEvent) -> usize
pub fn publish_event(&self, event: &SemanticEvent) -> usize
Non-injecting events use a separate opt-in subscriber set.
pub fn event_subscriber_count(&self) -> usize
Sourcepub fn subscriber_count(&self) -> usize
pub fn subscriber_count(&self) -> usize
Number of currently connected local command stream subscribers.
Trait Implementations§
Source§impl Clone for CommandBus
impl Clone for CommandBus
Source§fn clone(&self) -> CommandBus
fn clone(&self) -> CommandBus
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for CommandBus
impl Default for CommandBus
Source§fn default() -> CommandBus
fn default() -> CommandBus
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CommandBus
impl RefUnwindSafe for CommandBus
impl Send for CommandBus
impl Sync for CommandBus
impl Unpin for CommandBus
impl UnsafeUnpin for CommandBus
impl UnwindSafe for CommandBus
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