INNER CODE UNIT · Rust
flush
gosub-io/gosub-engine · crates/gosub_config/src/lib.rs:41
fn flush(&self) -> Result<()> {
Ok(())
}
}
/// Identifies a registered subscription so it can later be removed via [`Config::unsubscribe`].
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct SubscriptionId(u64);
/// Callback invoked when a watched setting changes. It receives the setting key and the new value.
///
/// The callback is invoked after the store's internal lock has been released, so it MAY read or
/// write the same [`Config`] without deadlocking. Beware infinite recursion if a callback sets a
/// key it also subscribes to.
pub type SubscriptionCallback = Arc<dyn Fn(&str, &Setting) + Send + Sync>;
struct Subscription {
id: SubscriptionId,