MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / ws

Function ws

src/net/mod.rs:441–447  ·  view source on GitHub ↗

Get a handle to an existing WebSocket. Returns `None` if no such ID.

(id: &str)

Source from the content-addressed store, hash-verified

439
440/// Get a handle to an existing WebSocket. Returns `None` if no such ID.
441pub fn ws(id: &str) -> Option<WebSocket> {
442 let key = hash_id(id);
443 let mut mgr = NET_MANAGER.lock().unwrap();
444 let entry = mgr.websockets.get_mut(&key)?;
445 entry.frames_not_accessed = 0;
446 Some(WebSocket { id: key })
447}
448
449#[cfg(not(target_arch = "wasm32"))]
450#[derive(Debug)]

Callers

nothing calls this directly

Calls 1

hash_idFunction · 0.85

Tested by

no test coverage detected