NoopHandler

Struct NoopHandler 

Source
pub struct NoopHandler;
Expand description

Default no-op handler. Accepts all connections, ignores all events.

Trait Implementations§

Source§

impl ServerHandler for NoopHandler

Source§

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>)

Called when a client requests to join a room. Read more
Source§

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)

Called after a room is created (including via ServerHandle::create_room_runtime).
Source§

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])

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)

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)

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.