pub struct CommandSender { /* private fields */ }Expand description
A cloneable handle for sending commands into the control channel.
Any frontend (TUI, web, CLI oneshot) can clone this and send commands.
Implementations§
Source§impl CommandSender
impl CommandSender
Sourcepub async fn send(&self, cmd: AppCommand) -> Result<(), SendError<AppCommand>>
pub async fn send(&self, cmd: AppCommand) -> Result<(), SendError<AppCommand>>
Sends a command to the control channel.
@param cmd - The command to send
Sourcepub fn try_send(&self, cmd: AppCommand) -> Result<(), TrySendError<AppCommand>>
pub fn try_send(&self, cmd: AppCommand) -> Result<(), TrySendError<AppCommand>>
Tries to send a command without blocking.
Useful for synchronous contexts (e.g., TUI event handlers).
@param cmd - The command to send
Trait Implementations§
Source§impl Clone for CommandSender
impl Clone for CommandSender
Source§fn clone(&self) -> CommandSender
fn clone(&self) -> CommandSender
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 moreAuto Trait Implementations§
impl Freeze for CommandSender
impl RefUnwindSafe for CommandSender
impl Send for CommandSender
impl Sync for CommandSender
impl Unpin for CommandSender
impl UnsafeUnpin for CommandSender
impl UnwindSafe for CommandSender
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