INNER CODE UNIT · Rust

set

gosub-io/gosub-engine · crates/gosub_config/src/lib.rs:28

    fn set(&self, key: &str, value: Setting) -> Result<()>;

    /// Removes a stored setting from the storage. Removing a key that does not exist is not an error
    /// (the operation is idempotent). This is used to revert a setting back to its default value.
    fn remove(&self, key: &str) -> Result<()>;

    /// Retrieves all the settings in the storage in one go. This is used for preloading the settings
    /// into the `ConfigStore` and is more performant normally than calling `get_setting` manually for each
    /// setting.
    fn all(&self) -> Result<HashMap<String, Setting>>;

    /// Flushes any buffered writes to the backing store. Adapters that persist eagerly on every
    /// `set` (or not at all, like the in-memory adapter) treat this as a no-op.
    fn flush(&self) -> Result<()> {
        Ok(())
    }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…