MapWriteLayer

interface MapWriteLayer<K, V>

Acts as the kernel for actually persisting/storing items in a PersistentMap. Many of these are not exposed through PersistentMap but they're required to make certain guarantees in the apis that are exposed.

These implementations don't have to try to solve concurrency problems. They'll be used from the PersistentMap that deals with concurrency by serializing all access.

Functions

Link copied to clipboard
abstract suspend fun clear()

Erase everything.

Link copied to clipboard
abstract suspend fun get(key: K): V?

Get the value V for the key K if it exists, or return null.

Link copied to clipboard
abstract suspend fun getAll(): Map<K, V>

Get all key/value pairs as a map that are currently stored.

Link copied to clipboard
abstract suspend fun remove(key: K)

Remove the key if it exists. Doesn't do anything if the key doesn't exist.

Link copied to clipboard
abstract suspend fun reset(to: Map<K, V>)

Wipe out the current state and replace it with to

Link copied to clipboard
abstract suspend fun set(key: K, value: V)

Set the value V for key K

Link copied to clipboard
abstract suspend fun size(): Int

Get the number of entries.

Inheritors

Link copied to clipboard
Link copied to clipboard