Struct config_it::storage::Storage

source ·
pub struct Storage { /* private fields */ }
Expand description

Storage manages multiple sets registered by preset key.

Implementations§

Creates new storage and its driver.

The second tuple parameter is asynchronous loop which handles all storage events, which must be spawned or blocked by runtime to make storage work. All storage

Creates and register new config set.

If path is duplicated for existing config set, the program will panic.

Dump all configs from storage.

Arguments
  • no_merge - If true, only active archive contents will be collected. Otherwise, result will contain merge result of previously loaded archive.
  • no_update - If true, existing archive won’t

Deserializes data

Arguments
  • de - Deserializer
  • merge - True if loaded archive should merge onto existing one. Otherwise, it’ll replace currently loaded archive data.
Data serialization rule:
  • The first path component is root component, which is written as-is.
  • Any path component after the first must be prefixed with ~(tilde) character.
    • Otherwise, they are treated as field element of enclosing path component.
  • Any ‘~’ prefixed key inside of existing field
{
    "root_path": {
        "~path_component": {
            "field_name": "value",
            "other_field": {
                "~this_is_not_treated_as_path"
            }
        },
        "~another_path_component": {},
        "field_name_of_root_path": "yay"
    },
    "another_root_path": {}
}

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.