Struct diem_secure_storage::InMemoryStorage
source · pub struct InMemoryStorage { /* private fields */ }
Expand description
InMemoryStorage represents a key value store that is purely in memory and intended for single threads (or must be wrapped by a Arc<RwLock<>>). This provides no permission checks and simply is a proof of concept to unblock building of applications without more complex data stores. Internally, it retains all data, 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§
source§impl InMemoryStorage
impl InMemoryStorage
pub fn new_with_time_service(time_service: TimeService) -> Self
Trait Implementations§
source§impl Default for InMemoryStorage
impl Default for InMemoryStorage
source§fn default() -> InMemoryStorage
fn default() -> InMemoryStorage
Returns the “default value” for a type. Read more
source§impl From<InMemoryStorage> for Storage
impl From<InMemoryStorage> for Storage
source§fn from(v: InMemoryStorage) -> Storage
fn from(v: InMemoryStorage) -> Storage
Converts to this type from the input type.
source§impl KVStorage for InMemoryStorage
impl KVStorage for InMemoryStorage
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.