Trait dscfg_server::Storage
source · pub trait Storage {
type SetError: IsFatalError;
type GetError: IsFatalError;
fn set(&mut self, key: String, value: Value) -> Result<(), Self::SetError>;
fn get(&mut self, key: &str) -> Result<Option<Value>, Self::GetError>;
}
Expand description
Specification of interface for accessing configuration.
The configuration can be stored using many different methods. In order to implement a new way of storing configuration data, you must implement this trait for your type.
Required Associated Types
sourcetype SetError: IsFatalError
type SetError: IsFatalError
Error which may occur when attempting to write to the storage.
sourcetype GetError: IsFatalError
type GetError: IsFatalError
Error which may occur when attempting to read from the storage.