Skip to main content

Mountain/RPC/CocoonService/Window/
ShowInformationMessage.rs

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