pub struct NoopHandler;Expand description
Default no-op handler. Accepts all connections, ignores all events.
Trait Implementations§
Source§impl ServerHandler for NoopHandler
impl ServerHandler for NoopHandler
Source§fn on_connect(&self, _addr: SocketAddr) -> bool
fn on_connect(&self, _addr: SocketAddr) -> bool
Called when a new TCP connection arrives. Return
false to reject it.
Called before any resources are allocated for the connection.Source§fn on_join(
&self,
_client_id: Uuid,
_room_id: &str,
_addr: SocketAddr,
_data: &[u8],
) -> (bool, Option<String>)
fn on_join( &self, _client_id: Uuid, _room_id: &str, _addr: SocketAddr, _data: &[u8], ) -> (bool, Option<String>)
Called when a client requests to join a room. Read more
Source§fn on_leave(&self, _client_id: Uuid, _room_id: &str)
fn on_leave(&self, _client_id: Uuid, _room_id: &str)
Called when a client leaves a room (or disconnects).
Source§fn on_room_create(&self, _room_id: &str)
fn on_room_create(&self, _room_id: &str)
Called after a room is created (including via
ServerHandle::create_room_runtime).Source§fn on_room_delete(&self, _room_id: &str)
fn on_room_delete(&self, _room_id: &str)
Called after a room is deleted.
Source§fn on_broadcast(&self, _client_id: Uuid, _room_id: &str, _data: &[u8])
fn on_broadcast(&self, _client_id: Uuid, _room_id: &str, _data: &[u8])
Called when a broadcast message is relayed.
client_id is the sender, and the message has already been relayed to all peers.
Source§fn on_backpressure(&self, _client_id: Uuid, _room_id: &str)
fn on_backpressure(&self, _client_id: Uuid, _room_id: &str)
Called when a frame is dropped because a client’s write channel is full.
The affected clients are identified by their UUIDs. Read more
Source§fn on_shutdown(&self)
fn on_shutdown(&self)
Called when server is shutdown via ctrl-c (shutdown signals)
Can be used as a graceful shutdown signal for any background tasks or post-shutdown cleanup or jobs
Auto Trait Implementations§
impl Freeze for NoopHandler
impl RefUnwindSafe for NoopHandler
impl Send for NoopHandler
impl Sync for NoopHandler
impl Unpin for NoopHandler
impl UnwindSafe for NoopHandler
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