pub struct ServerHandle { /* private fields */ }Expand description
A handle to the running server. Cloneable; every clone references the same canonical canvas and client registry.
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
Sourcepub fn register_transport(
&self,
hello: Hello,
sender: Box<dyn ServerSink>,
) -> Result<UserId, String>
pub fn register_transport( &self, hello: Hello, sender: Box<dyn ServerSink>, ) -> Result<UserId, String>
Register a new client against an existing transport sink.
pub fn peer_count(&self) -> usize
pub fn canvas_snapshot(&self) -> Canvas
Sourcepub fn submit_op_for(
&self,
user_id: UserId,
client_op_id: ClientOpId,
op: CanvasOp,
)
pub fn submit_op_for( &self, user_id: UserId, client_op_id: ClientOpId, op: CanvasOp, )
Apply an op on behalf of an already-registered user.
Sourcepub fn disconnect_user(&self, user_id: UserId)
pub fn disconnect_user(&self, user_id: UserId)
Disconnect a previously-registered user and broadcast PeerLeft.
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