WSServerSocket

Trait WSServerSocket 

pub trait WSServerSocket<ClientMsg, ServerMsg>:
    Sized
    + Sync
    + 'static
where ClientMsg: Serialize + for<'a> Deserialize<'a> + Send, ServerMsg: Serialize + Debug + for<'a> Deserialize<'a> + Send,
{ const TIMEOUT: f32 = 10f32; // Required methods fn new( socket: WSSocket<ClientMsg, ServerMsg>, ) -> impl Future<Output = Self> + Send; fn handle(&self, msg: ClientMsg) -> impl Future<Output = bool> + Send; fn span(&self) -> Option<&'static Span>; // Provided methods fn allow_user(state: LoginState) -> bool { ... } async fn handler( auth_session: AuthSession<DBBackend>, ws: WebSocketUpgrade, ) -> Response<Body> where Self: Send { ... } }

Provided Associated Constants§

const TIMEOUT: f32 = 10f32

Required Methods§

fn new( socket: WSSocket<ClientMsg, ServerMsg>, ) -> impl Future<Output = Self> + Send

fn handle(&self, msg: ClientMsg) -> impl Future<Output = bool> + Send

fn span(&self) -> Option<&'static Span>

Provided Methods§

fn allow_user(state: LoginState) -> bool

async fn handler( auth_session: AuthSession<DBBackend>, ws: WebSocketUpgrade, ) -> Response<Body>
where Self: Send,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl WSServerSocket<(usize, TeXMath), (usize, Result<String, String>)> for TeXSocket

Available on crate feature ssr only.