pub struct WsHandle { /* private fields */ }Expand description
A lightweight, cloneable handle to the WebSocket server’s broadcast capability. Non-generic — can be passed across async task boundaries.
Constructed via WsServer::handle(). Used by the CLI to forward
meter updates from the in-process audio callback to browser clients.
Implementations§
Source§impl WsHandle
impl WsHandle
Sourcepub async fn broadcast(&self, json: &str)
pub async fn broadcast(&self, json: &str)
Broadcast a JSON string to all connected browser clients.
Sourcepub async fn broadcast_audio_status_changed(
&self,
status: &AudioRuntimeStatus,
) -> Result<(), Error>
pub async fn broadcast_audio_status_changed( &self, status: &AudioRuntimeStatus, ) -> Result<(), Error>
Broadcast an audioStatusChanged notification to connected clients.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WsHandle
impl !RefUnwindSafe for WsHandle
impl Send for WsHandle
impl Sync for WsHandle
impl Unpin for WsHandle
impl UnsafeUnpin for WsHandle
impl !UnwindSafe for WsHandle
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