pub trait KeyValueStorage {
// Required methods
fn read_storage(&self) -> Result<HashMap<ConfigKeys, String>, KSMRError>;
fn save_storage(
&mut self,
updated_config: HashMap<ConfigKeys, String>,
) -> Result<bool, KSMRError>;
fn get(&self, key: ConfigKeys) -> Result<Option<String>, KSMRError>;
fn set(
&mut self,
key: ConfigKeys,
value: String,
) -> Result<HashMap<ConfigKeys, String>, KSMRError>;
fn delete(
&mut self,
key: ConfigKeys,
) -> Result<HashMap<ConfigKeys, String>, KSMRError>;
fn delete_all(&mut self) -> Result<HashMap<ConfigKeys, String>, KSMRError>;
fn contains(&self, key: ConfigKeys) -> Result<bool, KSMRError>;
fn create_config_file_if_missing(&self) -> Result<(), KSMRError>;
fn is_empty(&self) -> Result<bool, KSMRError>;
}Required Methods§
fn read_storage(&self) -> Result<HashMap<ConfigKeys, String>, KSMRError>
fn save_storage( &mut self, updated_config: HashMap<ConfigKeys, String>, ) -> Result<bool, KSMRError>
fn get(&self, key: ConfigKeys) -> Result<Option<String>, KSMRError>
fn set( &mut self, key: ConfigKeys, value: String, ) -> Result<HashMap<ConfigKeys, String>, KSMRError>
fn delete( &mut self, key: ConfigKeys, ) -> Result<HashMap<ConfigKeys, String>, KSMRError>
fn delete_all(&mut self) -> Result<HashMap<ConfigKeys, String>, KSMRError>
fn contains(&self, key: ConfigKeys) -> Result<bool, KSMRError>
fn create_config_file_if_missing(&self) -> Result<(), KSMRError>
fn is_empty(&self) -> Result<bool, KSMRError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".