(&self)
| 186 | /// Returns the WebSocket protocol. |
| 187 | #[getter] |
| 188 | pub fn protocol(&self) -> Option<&str> { |
| 189 | self.protocol |
| 190 | .as_ref() |
| 191 | .map(HeaderValue::to_str) |
| 192 | .transpose() |
| 193 | .ok() |
| 194 | .flatten() |
| 195 | } |
| 196 | |
| 197 | /// Receives a message from the WebSocket. |
| 198 | pub fn recv<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>> { |