pub struct WsHandler;Expand description
WebSocket handler for a single client connection.
Implementations§
Source§impl WsHandler
impl WsHandler
Sourcepub async fn handle_connection(
stream: TcpStream,
addr: SocketAddr,
ctx: Arc<CellServerCtx>,
) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn handle_connection( stream: TcpStream, addr: SocketAddr, ctx: Arc<CellServerCtx>, ) -> Result<(), Box<dyn Error + Send + Sync>>
Handle a new WebSocket connection (performs the handshake).
Sourcepub async fn handle_upgraded(
ws_stream: WebSocketStream<TcpStream>,
addr: SocketAddr,
ctx: Arc<CellServerCtx>,
) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn handle_upgraded( ws_stream: WebSocketStream<TcpStream>, addr: SocketAddr, ctx: Arc<CellServerCtx>, ) -> Result<(), Box<dyn Error + Send + Sync>>
Handle a WebSocket connection whose HTTP/1.1 handshake has already
completed and produced a tokio_tungstenite::WebSocketStream.
Used by the front-door router when it pre-parses the HTTP request
(to dispatch between /myko WS and /myko/mcp HTTP/WS) and then
completes the WS handshake itself.
Auto Trait Implementations§
impl Freeze for WsHandler
impl RefUnwindSafe for WsHandler
impl Send for WsHandler
impl Sync for WsHandler
impl Unpin for WsHandler
impl UnsafeUnpin for WsHandler
impl UnwindSafe for WsHandler
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more