1use serde::{Deserialize, Serialize};
2
3use crate::Result;
4
5use super::request;
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
9#[serde(rename_all = "camelCase")]
10pub enum NotifyType {
11 InApp,
13 Native,
15}
16
17#[derive(Debug, Serialize, Deserialize)]
18struct NotifyParams<'a> {
19 #[serde(rename = "type")]
20 pub ty: NotifyType,
21 pub message: &'a str,
22}
23
24pub async fn notify(ty: NotifyType, message: &str) -> Result<()> {
28 request("snap_notify", NotifyParams { ty, message }).await
29}