Skip to main content

NotifySide

Trait NotifySide 

Source
pub trait NotifySide: Send + Sync {
    // Required methods
    fn show(&self, notification: &Notification) -> Result<(), Refusal>;
    fn withdraw(&self, tag: &str) -> Result<(), Refusal>;
    fn schedule(
        &self,
        notification: &Notification,
        at: SystemTime,
        alarm: Option<&AlarmRequest>,
    ) -> Result<(), Refusal>;
    fn scheduled(&self) -> Result<Vec<Scheduled>, Refusal>;
    fn alarm_states(&self) -> Result<Vec<AlarmState>, Refusal>;
    fn cancel_scheduled(&self, tag: &str) -> Result<(), Refusal>;

    // Provided methods
    fn attached(&self, channel: Arc<Channel>) { ... }
    fn priority_contacts(
        &self,
        _contacts: &[PriorityContact],
    ) -> Result<(), Refusal> { ... }
}
Expand description

What answers on the session’s end of an app’s notification connection: the session’s notifications daemon, attributed to the app the connection is for.

Required Methods§

Source

fn show(&self, notification: &Notification) -> Result<(), Refusal>

Show notification, or replace the app’s notification with its tag.

Source

fn withdraw(&self, tag: &str) -> Result<(), Refusal>

Withdraw the app’s notification with tag.

Source

fn schedule( &self, notification: &Notification, at: SystemTime, alarm: Option<&AlarmRequest>, ) -> Result<(), Refusal>

Hand notification over for at, with alarm for one that rings at a wall-clock time.

Source

fn scheduled(&self) -> Result<Vec<Scheduled>, Refusal>

The app’s deadlines still to fall due.

Source

fn alarm_states(&self) -> Result<Vec<AlarmState>, Refusal>

The app’s alarms, and what the session delivered of them.

Source

fn cancel_scheduled(&self, tag: &str) -> Result<(), Refusal>

Cancel the app’s deadline with tag.

Provided Methods§

Source

fn attached(&self, channel: Arc<Channel>)

The side of this connection that tells the app what happened to its notifications, before the first request. The connection closes with the app, and so does the side.

Source

fn priority_contacts( &self, _contacts: &[PriorityContact], ) -> Result<(), Refusal>

Replace the people whose messages may break through focus and Do Not Disturb with contacts, as this app knows them. A side that keeps no priority contacts.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§