Skip to main content

antbox_engine/
notifier.rs

1use crate::Notification;
2
3/// Applications provide a [Notifier] to the engine to receive engine updates
4pub trait Notifier: Send {
5    /// The error type `self` can return on failure to [Self::post]
6    type Error: std::fmt::Display;
7
8    /// Post a notification to the application
9    fn post<T>(&self, notif: T) -> Result<(), Self::Error>
10    where
11        T: Into<Notification>;
12}