pub struct WsServer { /* private fields */ }Expand description
WebSocket server for phone PWA connections.
Implementations§
Source§impl WsServer
impl WsServer
Sourcepub fn new(
config: WsServerConfig,
producer: NetBufferProducer,
command_rx: Receiver<ServerCommand>,
) -> Self
pub fn new( config: WsServerConfig, producer: NetBufferProducer, command_rx: Receiver<ServerCommand>, ) -> Self
Create a new WebSocket server.
§Arguments
config- Server configurationproducer- Buffer producer for sending messages to audio threadcommand_rx- Channel for receiving commands from main thread
Sourcepub fn command_channel() -> (Sender<ServerCommand>, Receiver<ServerCommand>)
pub fn command_channel() -> (Sender<ServerCommand>, Receiver<ServerCommand>)
Create a command channel pair for communicating with the server.
Sourcepub fn subscribe(&self) -> Receiver<ServerMessage>
pub fn subscribe(&self) -> Receiver<ServerMessage>
Get a handle to subscribe to state broadcasts.
Auto Trait Implementations§
impl Freeze for WsServer
impl !RefUnwindSafe for WsServer
impl Send for WsServer
impl Sync for WsServer
impl Unpin for WsServer
impl !UnwindSafe for WsServer
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