(&mut self, reason: WsCloseReason)
| 127 | } |
| 128 | |
| 129 | async fn close(&mut self, reason: WsCloseReason) { |
| 130 | if matches!(reason, WsCloseReason::ClientDisconnected) { |
| 131 | // connection is already closed |
| 132 | return; |
| 133 | } |
| 134 | |
| 135 | let code = reason.code(); |
| 136 | let desc = reason.description(); |
| 137 | |
| 138 | self.socket |
| 139 | .send(Message::Close(Some(CloseFrame { |
| 140 | code, |
| 141 | reason: Cow::from(desc), |
| 142 | }))) |
| 143 | .await |
| 144 | .ok(); // we don't really care about the error here |
| 145 | } |
| 146 | |
| 147 | async fn handle_ws_message(&mut self, msg: Message) -> WsResult { |
| 148 | match msg { |
nothing calls this directly
no test coverage detected