fleche.storage.memory

Classes

MemoryBackend

A concrete implementation of Storage that stores values in an in-memory dictionary.

ValueMemory

Bridges ValueStorage with StorageBackend primitives.

CallMemory

Bridges CallStorage with StorageBackend primitives.

Module Contents

class fleche.storage.memory.MemoryBackend[source]

Bases: fleche.storage.base.StorageBackend

A concrete implementation of Storage that stores values in an in-memory dictionary.

storage: dict[fleche.digest.Digest, Any][source]
list() Iterable[fleche.digest.Digest][source]
put(value: Any, key: fleche.digest.Digest) fleche.digest.Digest[source]
get(key: fleche.digest.Digest) Any[source]
_contains(key: fleche.digest.Digest) bool[source]
_evict(key: fleche.digest.Digest) None[source]
class fleche.storage.memory.ValueMemory[source]

Bases: fleche.storage.base.ValueMixin, fleche.storage.base.DestructuringMixin, MemoryBackend

Bridges ValueStorage with StorageBackend primitives.

Implements save and load using put and get. Concrete classes inherit from this and a StorageBackend implementation to get a fully functional value storage.

class fleche.storage.memory.CallMemory[source]

Bases: fleche.storage.base.CallMixin, MemoryBackend

Bridges CallStorage with StorageBackend primitives.

Implements save, load, and query using put and get, deriving the storage key from the call’s lookup key. transform is inherited from CallStorage.

Concrete classes inherit from this and a StorageBackend implementation to get a fully functional call storage.