Skip to main content

Mountain/RPC/CocoonService/Debug/
StopDebugging.rs

1#![allow(non_snake_case)]
2
3//! Stop an active debug session. Emits `sky://debug/sessionEnd` (NOT
4//! `/stop` - Sky listens on the former at `SkyBridge.ts:2234`;
5//! `DebugProvider.rs:351` emits the same channel from the lifecycle path).
6
7use serde_json::json;
8use tauri::Emitter;
9use tonic::{Response, Status};
10
11use crate::{
12	RPC::CocoonService::CocoonServiceImpl,
13	Vine::Generated::{Empty, StopDebuggingRequest},
14	dev_log,
15};
16
17pub async fn Fn(Service:&CocoonServiceImpl, Request:StopDebuggingRequest) -> Result<Response<Empty>, Status> {
18	dev_log!("cocoon", "[CocoonService] stop_debugging: session={}", Request.session_id);
19
20	let _ = Service
21		.environment
22		.ApplicationHandle
23		.emit("sky://debug/sessionEnd", json!({ "sessionId": Request.session_id }));
24
25	Ok(Response::new(Empty {}))
26}