Skip to main content

Mountain/RPC/CocoonService/Window/
ShowWarningMessage.rs

1//! Display a warning-severity message via the `UserInterfaceProvider`.
2
3use tonic::{Response, Status};
4use CommonLibrary::UserInterface::{
5	DTO::MessageSeverity::MessageSeverity,
6	UserInterfaceProvider::UserInterfaceProvider,
7};
8use ::Vine::Generated::{ShowMessageRequest, ShowMessageResponse};
9
10use crate::{RPC::CocoonService::CocoonServiceImpl, dev_log};
11
12pub async fn Fn(
13	Service:&CocoonServiceImpl,
14
15	Request:ShowMessageRequest,
16) -> Result<Response<ShowMessageResponse>, Status> {
17	dev_log!("cocoon", "warn: [CocoonService] show_warning_message: {}", Request.message);
18
19	let _ = Service
20		.environment
21		.ShowMessage(MessageSeverity::Warning, Request.message, None)
22		.await;
23
24	Ok(Response::new(ShowMessageResponse { success:true }))
25}