A store of T values, written as the JSON text of the schema's
JSON form (so dates, bytes and options survive). get and set
fail with SchemaError for values the schema rejects.
Attributes#
| Attribute | Type | Description |
|---|---|---|
get | Callable[[str], Effect[Option[T], KeyValueStoreError | SchemaError, RD_co]] | |
set | Callable[[str, T], Effect[None, KeyValueStoreError | SchemaError, RE_co]] | |
modify | Callable[[str, Callable[[T], T]], Effect[Option[T], KeyValueStoreError | SchemaError, RD_co | RE_co]] | Replace a present value with |
remove | Callable[[str], Effect[None, KeyValueStoreError]] | |
clear | Effect[None, KeyValueStoreError] | |
size | Effect[int, KeyValueStoreError] | |
keys | Effect[list[str], KeyValueStoreError] | A snapshot of the keys, in no particular order. |
has | Callable[[str], Effect[bool, KeyValueStoreError]] | |
is_empty | Effect[bool, KeyValueStoreError] |
Functions#
__init__#
__init__(*, get, set, modify, remove, clear, size, keys, has, is_empty) -> None| Parameter | Type | Description |
|---|---|---|
get | Callable[[str], Effect[Option[T], KeyValueStoreError | SchemaError, RD_co]] | |
set | Callable[[str, T], Effect[None, KeyValueStoreError | SchemaError, RE_co]] | |
modify | Callable[[str, Callable[[T], T]], Effect[Option[T], KeyValueStoreError | SchemaError, RD_co | RE_co]] | |
remove | Callable[[str], Effect[None, KeyValueStoreError]] | |
clear | Effect[None, KeyValueStoreError] | |
size | Effect[int, KeyValueStoreError] | |
keys | Effect[list[str], KeyValueStoreError] | |
has | Callable[[str], Effect[bool, KeyValueStoreError]] | |
is_empty | Effect[bool, KeyValueStoreError] |