pub struct SimpleWebSocketHandler<F> { /* private fields */ }
Expand description
Simple WebSocket handler implementation for basic use cases
Implementations§
Source§impl<F, Fut> SimpleWebSocketHandler<F>where
F: Fn(ConnectionId, Arc<WebSocketConnection>) -> Fut + Send + Sync + 'static,
Fut: Future<Output = ()> + Send,
impl<F, Fut> SimpleWebSocketHandler<F>where
F: Fn(ConnectionId, Arc<WebSocketConnection>) -> Fut + Send + Sync + 'static,
Fut: Future<Output = ()> + Send,
Trait Implementations§
Source§impl<F: Clone> Clone for SimpleWebSocketHandler<F>
impl<F: Clone> Clone for SimpleWebSocketHandler<F>
Source§fn clone(&self) -> SimpleWebSocketHandler<F>
fn clone(&self) -> SimpleWebSocketHandler<F>
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 moreSource§impl<F, Fut> WebSocketHandler for SimpleWebSocketHandler<F>where
F: Fn(ConnectionId, Arc<WebSocketConnection>) -> Fut + Send + Sync + 'static,
Fut: Future<Output = ()> + Send,
impl<F, Fut> WebSocketHandler for SimpleWebSocketHandler<F>where
F: Fn(ConnectionId, Arc<WebSocketConnection>) -> Fut + Send + Sync + 'static,
Fut: Future<Output = ()> + Send,
Source§async fn handle_connection(
&self,
id: ConnectionId,
connection: Arc<WebSocketConnection>,
)
async fn handle_connection( &self, id: ConnectionId, connection: Arc<WebSocketConnection>, )
Handle a new WebSocket connection
Auto Trait Implementations§
impl<F> Freeze for SimpleWebSocketHandler<F>where
F: Freeze,
impl<F> RefUnwindSafe for SimpleWebSocketHandler<F>where
F: RefUnwindSafe,
impl<F> Send for SimpleWebSocketHandler<F>where
F: Send,
impl<F> Sync for SimpleWebSocketHandler<F>where
F: Sync,
impl<F> Unpin for SimpleWebSocketHandler<F>where
F: Unpin,
impl<F> UnwindSafe for SimpleWebSocketHandler<F>where
F: UnwindSafe,
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