MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / remove

Method remove

packages/server/src/api/routes.rs:289–302  ·  view source on GitHub ↗
(&self, udid: &str, client_id: &str)

Source from the content-addressed store, hash-verified

287 }
288
289 pub fn remove(&self, udid: &str, client_id: &str) -> (bool, bool) {
290 let now = Instant::now();
291 let mut clients = self
292 .inner
293 .lock()
294 .unwrap_or_else(|poisoned| poisoned.into_inner());
295 clients.retain(|_, state| {
296 now.duration_since(state.updated_at) <= STREAM_CLIENT_FOREGROUND_TTL
297 });
298 let previous = any_foreground_client_for_udid(&clients, udid);
299 clients.remove(&(udid.to_owned(), client_id.to_owned()));
300 let next = any_foreground_client_for_udid(&clients, udid).unwrap_or(false);
301 (next, previous != Some(next))
302 }
303}
304
305fn any_foreground_client_for_udid(

Callers

nothing calls this directly

Calls 2

removeMethod · 0.65

Tested by

no test coverage detected