Get a handle to an existing HTTP request. Returns `None` if no such ID.
(id: &str)
| 236 | |
| 237 | /// Get a handle to an existing HTTP request. Returns `None` if no such ID. |
| 238 | pub fn request(id: &str) -> Option<Request> { |
| 239 | let key = hash_id(id); |
| 240 | let mut mgr = NET_MANAGER.lock().unwrap(); |
| 241 | let entry = mgr.http_requests.get_mut(&key)?; |
| 242 | entry.frames_not_accessed = 0; |
| 243 | Some(Request { id: key }) |
| 244 | } |
| 245 | |
| 246 | /// Connect a WebSocket. Idempotent: won't reconnect if already open. |
| 247 | pub fn ws_connect( |