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§
Sourcefn show(&self, notification: &Notification) -> Result<(), Refusal>
fn show(&self, notification: &Notification) -> Result<(), Refusal>
Show notification, or replace the app’s notification with its tag.
Sourcefn schedule(
&self,
notification: &Notification,
at: SystemTime,
alarm: Option<&AlarmRequest>,
) -> Result<(), Refusal>
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.
Sourcefn alarm_states(&self) -> Result<Vec<AlarmState>, Refusal>
fn alarm_states(&self) -> Result<Vec<AlarmState>, Refusal>
The app’s alarms, and what the session delivered of them.
Provided Methods§
Sourcefn attached(&self, channel: Arc<Channel>)
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.
Sourcefn priority_contacts(
&self,
_contacts: &[PriorityContact],
) -> Result<(), Refusal>
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".