Module ockam_node::storage

source ·
Expand description

Support for storing persistent values

Structs

  • Key value storage backed by a file An additional cache in used to access values in memory and avoid re-reading the file too frequently WARNING: This implementation provides limited consistency if the same file is reused from multiple instances and/or processes. For example, if one process deletes a value, the other process will still have it in its cache and return it on a Get query. NOTE: Currently, unused
  • File Storage There three files involved
  • In memory implementation of a key / value storage
  • In memory implementation of a value storage

Enums

Traits

  • This trait defines a key/value storage
  • This trait needs to be implemented by structs which are used as keys in a key/value file This constraint is necessary due to the persistence of values as JSON in the underlying FileValueStorage
  • This trait defines a storage interface for serializable values It uses a closures in its interface in order to support a transactional behaviour and recovery from errors. If the closure does not return a successful value then no change is performed