pub struct ServerHandle { /* private fields */ }Implementations§
Source§impl ServerHandle
impl ServerHandle
pub fn spawn_local<S: CanvasStore + 'static>(store: S) -> Self
pub fn spawn_local_with_color_selection_mode<S: CanvasStore + 'static>( store: S, color_selection_mode: ColorSelectionMode, ) -> Self
pub fn try_connect_local(&self, hello: Hello) -> ConnectOutcome
pub fn connect_local(&self, hello: Hello) -> LocalClient
pub fn peer_count(&self) -> usize
pub fn canvas_snapshot(&self) -> Canvas
Sourcepub fn bind_ws(&self, addr: SocketAddr) -> Result<()>
pub fn bind_ws(&self, addr: SocketAddr) -> Result<()>
Bind a TCP listener on addr, spawn a dedicated tokio runtime thread,
and accept WebSocket connections. Each accepted connection talks the
same [ClientMsg]/[ServerMsg] protocol as LocalClient, framed as
JSON over ws frames.
Blocks only for the initial bind; returns once the listener is live. The accept loop runs until the process exits.
Trait Implementations§
Source§impl Clone for ServerHandle
impl Clone for ServerHandle
Source§fn clone(&self) -> ServerHandle
fn clone(&self) -> ServerHandle
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 ServerHandle
impl RefUnwindSafe for ServerHandle
impl Send for ServerHandle
impl Sync for ServerHandle
impl Unpin for ServerHandle
impl UnsafeUnpin for ServerHandle
impl UnwindSafe for ServerHandle
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