pub struct NotificationHandle { /* private fields */ }Expand description
A notification that has been delivered to the system but not yet responded to.
Call .response().await to wait for the user’s interaction,
or drop it to stop observing.
The notification stays visible but the response sender is cleaned up.
Implementations§
Source§impl NotificationHandle
impl NotificationHandle
Sourcepub fn notification_id(&self) -> &str
pub fn notification_id(&self) -> &str
The notification’s request identifier.
Can be passed to close_delivered or cancel_pending even when no
explicit ID was set via Notification::id.
Sourcepub async fn response(self) -> Result<NotificationResponse, Error>
pub async fn response(self) -> Result<NotificationResponse, Error>
Wait for the user’s response.
Resolves when the user interacts with or dismisses the notification.
If a timeout was set via Notification::timeout, the notification is
automatically removed from the screen when it elapses and this returns
Ok(response) where NotificationResponse::is_timed_out is true.
UNUserNotificationCenter has no native TTL; the close is performed
by this crate calling close_delivered when the timer fires.