Mountain/RPC/CocoonService/Window/
ReportProgress.rs1#![allow(non_snake_case)]
2
3use serde_json::json;
6use tauri::Emitter;
7use tonic::{Response, Status};
8
9use crate::{
10 RPC::CocoonService::CocoonServiceImpl,
11 Vine::Generated::{Empty, ReportProgressRequest},
12 dev_log,
13};
14
15pub async fn Fn(Service:&CocoonServiceImpl, Request:ReportProgressRequest) -> Result<Response<Empty>, Status> {
16 dev_log!("cocoon", "[CocoonService] report_progress: handle={}", Request.handle);
17
18 let _ = Service.environment.ApplicationHandle.emit(
19 "sky://progress/update",
20 json!({
21 "handle": Request.handle,
22 "message": Request.message,
23 "increment": Request.increment,
24 }),
25 );
26
27 Ok(Response::new(Empty {}))
28}