Struct ashpd::desktop::notification::NotificationProxy [−][src]
pub struct NotificationProxy<'a>(_);
Expand description
The interface lets sandboxed applications send and withdraw notifications.
It is not possible for the application to learn if the notification was actually presented to the user. Not a portal in the strict sense, since there is no user interaction.
Note that in contrast to most other portal requests, notifications are expected to outlast the running application. If a user clicks on a notification after the application has exited, it will get activated again.
Notifications can specify actions that can be activated by the user.
Actions whose name starts with ‘app.’ are assumed to be exported and will be
activated via the ActivateAction() method in the org.freedesktop.Application
interface. Other actions are activated by sending the
#org.freedeskop.portal.Notification::ActionInvoked
signal to the
application.
Implementations
Create a new instance of NotificationProxy
.
Signal emitted when a particular action is invoked.
pub async fn add_notification(
&self,
id: &str,
notification: Notification
) -> Result<(), Error>
pub async fn add_notification(
&self,
id: &str,
notification: Notification
) -> Result<(), Error>
Sends a notification.
The ID can be used to later withdraw the notification. If the application reuses the same ID without withdrawing, the notification is replaced by the new one.
Arguments
id
- Application-provided ID for this notification.notification
- The notification.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for NotificationProxy<'a>
impl<'a> Send for NotificationProxy<'a>
impl<'a> Sync for NotificationProxy<'a>
impl<'a> Unpin for NotificationProxy<'a>
impl<'a> !UnwindSafe for NotificationProxy<'a>