pub struct ControlChannel { /* private fields */ }Expand description
Handle for creating senders and subscribers to the control channel.
This is the factory for creating client connections to the message bus.
Implementations§
Source§impl ControlChannel
impl ControlChannel
Sourcepub fn sender(&self) -> CommandSender
pub fn sender(&self) -> CommandSender
Creates a new CommandSender for a frontend client.
Sourcepub fn subscribe(&self) -> Receiver<StateUpdate>
pub fn subscribe(&self) -> Receiver<StateUpdate>
Subscribes to state updates from the command processor.
@returns A broadcast receiver for state updates
Sourcepub fn take_command_rx(&mut self) -> Option<Receiver<AppCommand>>
pub fn take_command_rx(&mut self) -> Option<Receiver<AppCommand>>
Takes the command receiver (can only be called once).
This is consumed by the CommandProcessor during initialization.
@returns The command receiver, or None if already taken
Sourcepub fn broadcast_tx(&self) -> Sender<StateUpdate>
pub fn broadcast_tx(&self) -> Sender<StateUpdate>
Gets a clone of the broadcast sender.
Used by the CommandProcessor to broadcast state updates.
Auto Trait Implementations§
impl Freeze for ControlChannel
impl !RefUnwindSafe for ControlChannel
impl Send for ControlChannel
impl Sync for ControlChannel
impl Unpin for ControlChannel
impl UnsafeUnpin for ControlChannel
impl !UnwindSafe for ControlChannel
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