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

Function refresh_stream

packages/server/src/api/routes.rs:2575–2589  ·  view source on GitHub ↗
(
    State(state): State<AppState>,
    Path(udid): Path<String>,
)

Source from the content-addressed store, hash-verified

2573}
2574
2575async fn refresh_stream(
2576 State(state): State<AppState>,
2577 Path(udid): Path<String>,
2578) -> Result<Json<Value>, AppError> {
2579 if android::is_android_id(&udid) {
2580 return Ok(json(json_value!({ "ok": true, "stream": "screenshot" })));
2581 }
2582 let session = state.registry.get_or_create_async(&udid).await?;
2583 if let Err(error) = session.ensure_started_async().await {
2584 state.registry.remove(&udid);
2585 return Err(error);
2586 }
2587 session.request_refresh();
2588 Ok(json(json_value!({ "ok": true })))
2589}
2590
2591async fn camera_webcams() -> Result<Json<Value>, AppError> {
2592 let webcams = task::spawn_blocking(camera::list_webcams_value)

Callers

nothing calls this directly

Calls 6

is_android_idFunction · 0.85
jsonFunction · 0.85
get_or_create_asyncMethod · 0.80
ensure_started_asyncMethod · 0.80
removeMethod · 0.65
request_refreshMethod · 0.45

Tested by

no test coverage detected