pub struct Notification {
pub id: String,
pub kind: String,
pub priority: String,
pub title: String,
pub body: Option<String>,
pub summary: Option<String>,
pub actions: Vec<NotifyAction>,
pub countdown: Option<Countdown>,
pub tag: String,
}Expand description
Mirrors srv’s OsNotification (crates/srv-core/src/backend/notify/policy.rs).
Unknown fields are ignored so srv can grow the payload first.
Fields§
§id: String§kind: String§priority: String§title: String§body: Option<String>§summary: Option<String>What the agent is working on — a small line under the body
(SPEC_OS_NOTIFICATIONS_RICH_CONTENT_AND_CLICK_TO_PANE_2026_09_25.md
§1.3). Absent from an older srv, and when the agent has none.
actions: Vec<NotifyAction>Buttons the toast offers. Absent from an older srv, and for every
notification but a pending shutdown. The id is one of a closed set
(keep); the label is app text, never an agent’s.
countdown: Option<Countdown>A live countdown to tick, where the platform can show one. Absent from an older srv.
tag: StringImplementations§
Source§impl Notification
impl Notification
pub fn is_attention(&self) -> bool
Sourcepub fn keep_label(&self) -> Option<&str>
pub fn keep_label(&self) -> Option<&str>
The label of the cancel button (Keep running, or a sensitive operation’s veto), when the toast offers one.
Sourcepub fn now_label(&self) -> Option<&str>
pub fn now_label(&self) -> Option<&str>
The label of the do-it-now button (Close now, …), when the toast offers one.
The buttons the toast offers, in order: (UserAction id, label). Only the two ids srv sends.
Trait Implementations§
Source§impl Clone for Notification
impl Clone for Notification
Source§fn clone(&self) -> Notification
fn clone(&self) -> Notification
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Notification
impl Debug for Notification
Source§impl Default for Notification
impl Default for Notification
Source§fn default() -> Notification
fn default() -> Notification
Source§impl<'de> Deserialize<'de> for Notification
impl<'de> Deserialize<'de> for Notification
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Notification
Source§impl PartialEq for Notification
impl PartialEq for Notification
impl StructuralPartialEq for Notification
Auto Trait Implementations§
impl Freeze for Notification
impl RefUnwindSafe for Notification
impl Send for Notification
impl Sync for Notification
impl Unpin for Notification
impl UnsafeUnpin for Notification
impl UnwindSafe for Notification
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.