Skip to main content

NotificationManager

Trait NotificationManager 

Source
pub trait NotificationManager {
    // Required methods
    fn new_notification(
        &self,
        notification: Notification,
    ) -> Result<(), NotiError>;
    fn close_notification(&self, id: u32) -> Result<(), NotiError>;
}
Expand description

This trait’s implementation is necessary for passing spell’s generated widget into the notification field of cast_spell macro. It is important to note that implementation of this trait is not on the spell generated widget/window but on the slint generated window. For example, a window with name TopBar will have a spell implemetation TopBarSpell. This trait will be implemented over TopBar.

Required Methods§

Source

fn new_notification(&self, notification: Notification) -> Result<(), NotiError>

This method is called when a new notification is sent.

Source

fn close_notification(&self, id: u32) -> Result<(), NotiError>

This method is called when CloseNotification Server method is invoked. It requres the implementation of the trait to close the notification with the provided id if it is open.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§