Sends a single [`WebSocketResponse`] over the provided [`WebSocket`].
(ws: &mut WebSocket, resp: WebSocketResponse)
| 481 | |
| 482 | /// Sends a single [`WebSocketResponse`] over the provided [`WebSocket`]. |
| 483 | async fn send_ws_response(ws: &mut WebSocket, resp: WebSocketResponse) -> Result<(), Error> { |
| 484 | let msg = serde_json::to_string(&resp).unwrap(); |
| 485 | let msg = Message::Text(msg.into()); |
| 486 | ws.send(msg).await?; |
| 487 | |
| 488 | Ok(()) |
| 489 | } |
| 490 | |
| 491 | /// Forwards a collection of Notices to the provided [`WebSocket`]. |
| 492 | async fn forward_notices( |
no test coverage detected