KeyValueSwayStore

org.sigilaris.node.jvm.storage.swaydb.KeyValueSwayStore
See theKeyValueSwayStore companion object
final class KeyValueSwayStore[K, V](map: Map[K, Array[Byte], Nothing, IO])(using evidence$1: ByteEncoder[V], evidence$2: ByteDecoder[V]) extends KeyValueStore[IO, K, V]

KeyValueStore implementation backed by a SwayDB persistent map.

Values are serialized to byte arrays using ByteEncoder/ByteDecoder.

Type parameters

K

the key type

V

the value type, which must have byte codec instances

Value parameters

map

the underlying SwayDB map

Attributes

Companion
object
Source
KeyValueSwayStore.scala
Graph
Supertypes
trait KeyValueStore[IO, K, V]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def close(): IO[Unit]

Closes the underlying SwayDB map and releases resources.

Closes the underlying SwayDB map and releases resources.

Attributes

Source
KeyValueSwayStore.scala
override def get(key: K): EitherT[IO, DecodeFailure, Option[V]]

Retrieves the value associated with the given key.

Retrieves the value associated with the given key.

Value parameters

key

the key to look up

Attributes

Returns

the value if found, or None

Definition Classes
Source
KeyValueSwayStore.scala
override def put(key: K, value: V): IO[Unit]

Associates the given value with the given key, overwriting any existing mapping.

Associates the given value with the given key, overwriting any existing mapping.

Value parameters

key

the key

value

the value to store

Attributes

Definition Classes
Source
KeyValueSwayStore.scala
override def remove(key: K): IO[Unit]

Removes the mapping for the given key, if it exists.

Removes the mapping for the given key, if it exists.

Value parameters

key

the key to remove

Attributes

Definition Classes
Source
KeyValueSwayStore.scala