pub trait SettingsStore {
// Required methods
fn read_bin(&self, key: &str) -> Result<Option<Vec<u8>>>;
fn write_bin(&self, key: &str, value: &[u8]) -> Result<()>;
fn exists(&self, key: &str) -> Result<bool>;
fn setting_keys(&self) -> Result<Vec<String>>;
}Expand description
Interface used to store and retrieve settings from the database.
To store IPLD blocks, use the BlockStore trait.
Required Methods§
Sourcefn read_bin(&self, key: &str) -> Result<Option<Vec<u8>>>
fn read_bin(&self, key: &str) -> Result<Option<Vec<u8>>>
Reads binary field from the Settings store. This should be used for
non-serializable data. For serializable data, use SettingsStoreExt::read_obj.
Sourcefn write_bin(&self, key: &str, value: &[u8]) -> Result<()>
fn write_bin(&self, key: &str, value: &[u8]) -> Result<()>
Writes binary field to the Settings store. This should be used for
non-serializable data. For serializable data, use SettingsStoreExt::write_obj.
Sourcefn setting_keys(&self) -> Result<Vec<String>>
fn setting_keys(&self) -> Result<Vec<String>>
Returns all setting keys.