Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions crates/settings/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#[macro_use]
pub mod macros;
pub mod manager;
pub mod registration;
pub mod schema;

// Re-export commonly used types and traits
Expand Down Expand Up @@ -640,6 +641,17 @@ pub trait Setting {
fn is_value_explicitly_set(&self) -> bool;
}

/// A trait that maps a setting to the change event of its settings group.
///
/// The setting macros implement this trait for each setting they define. This
/// lets the shared `Setting` implementations construct the correct group event
/// variant without expanding per-setting event code at each emit site.
pub trait SettingChangeEvent: Setting {
/// Returns the group event that reports a change to this setting for the
/// given reason.
fn change_event(reason: ChangeEventReason) -> <Self::Group as Entity>::Event;
}

/// Shared persistence operations for typed settings backed by secure storage.
///
/// Implementors remain responsible for routing their [`Setting`] lifecycle
Expand Down
Loading
Loading