INNER CODE UNIT · Rust

get

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

    fn get(&self, key: &str) -> Result<Option<Setting>>;

    /// Stores a given setting to the storage. Note that "self" is self and not "mut self". We need to be able
    /// to storage settings in a non-mutable way. That is mostly possible it seems with a mutex lock that we
    /// can get mutable.
    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.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…