Struct diem_secure_storage::OnDiskStorage
source · pub struct OnDiskStorage { /* private fields */ }
Expand description
OnDiskStorage represents a key value store that is persisted to the local filesystem and is intended for single threads (or must be wrapped by a Arc<RwLock<>>). This provides no permission checks and simply offers a proof of concept to unblock building of applications without more complex data stores. Internally, it reads and writes all data to a file, which means that it must make copies of all key material which violates the Diem code base. It violates it because the anticipation is that data stores would securely handle key material. This should not be used in production.
Implementations§
Trait Implementations§
source§impl From<OnDiskStorage> for Storage
impl From<OnDiskStorage> for Storage
source§fn from(v: OnDiskStorage) -> Storage
fn from(v: OnDiskStorage) -> Storage
Converts to this type from the input type.
source§impl KVStorage for OnDiskStorage
impl KVStorage for OnDiskStorage
source§fn available(&self) -> Result<(), Error>
fn available(&self) -> Result<(), Error>
Returns an error if the backend service is not online and available.
source§fn get<V: DeserializeOwned>(&self, key: &str) -> Result<GetResponse<V>, Error>
fn get<V: DeserializeOwned>(&self, key: &str) -> Result<GetResponse<V>, Error>
Retrieves a value from storage and fails if the backend is unavailable or the process has
invalid permissions.