pub struct NotificationPreferences {
pub enabled: bool,
pub on_clarification: bool,
pub on_tool_approval: bool,
pub on_context_pressure: bool,
pub on_subagent_complete: bool,
}Expand description
Per-user notification opt-in flags.
enabled is the master switch; when false, no notifications are produced
regardless of the per-category flags. Each per-category flag gates a single
notification category.
Every field defaults to true (via serde(default = ...)), so missing keys
in a partial JSON document are treated as opted-in.
Fields§
§enabled: boolMaster switch. When false, nothing is ever notified.
on_clarification: boolNotify when the agent needs free-form clarification from the user.
on_tool_approval: boolNotify when a tool requires explicit user approval.
on_context_pressure: boolNotify when context usage reaches a critical level.
on_subagent_complete: boolNotify when a background sub-agent task completes.
Implementations§
Source§impl NotificationPreferences
impl NotificationPreferences
Sourcepub fn load(path: &Path) -> Self
pub fn load(path: &Path) -> Self
Loads preferences from path.
Returns Default when the file is missing (a fresh install) so the
caller never has to special-case first run. A file that exists but fails
to parse is logged via tracing::warn and also falls back to
Default, so a corrupt file never disables notifications silently.
Trait Implementations§
Source§impl Clone for NotificationPreferences
impl Clone for NotificationPreferences
Source§fn clone(&self) -> NotificationPreferences
fn clone(&self) -> NotificationPreferences
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 NotificationPreferences
impl Debug for NotificationPreferences
Source§impl Default for NotificationPreferences
impl Default for NotificationPreferences
Source§impl<'de> Deserialize<'de> for NotificationPreferences
impl<'de> Deserialize<'de> for NotificationPreferences
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>,
Source§impl PartialEq for NotificationPreferences
impl PartialEq for NotificationPreferences
Source§fn eq(&self, other: &NotificationPreferences) -> bool
fn eq(&self, other: &NotificationPreferences) -> bool
self and other values to be equal, and is used by ==.