Trait forest_filecoin::db::SettingsStore

source ·
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§

source

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.

source

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.

source

fn exists(&self, key: &str) -> Result<bool>

Returns Ok(true) if key exists in store.

source

fn setting_keys(&self) -> Result<Vec<String>>

Returns all setting keys.

Implementations on Foreign Types§

source§

impl<T: SettingsStore> SettingsStore for Arc<T>

source§

fn read_bin(&self, key: &str) -> Result<Option<Vec<u8>>>

source§

fn write_bin(&self, key: &str, value: &[u8]) -> Result<()>

source§

fn exists(&self, key: &str) -> Result<bool>

source§

fn setting_keys(&self) -> Result<Vec<String>>

Implementors§