GitHub

SchemaStore

API reference for SchemaStore.

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

AttributeTypeDescription
getCallable[[str], Effect[Option[T], KeyValueStoreError | SchemaError, RD_co]]
setCallable[[str, T], Effect[None, KeyValueStoreError | SchemaError, RE_co]]
modifyCallable[[str, Callable[[T], T]], Effect[Option[T], KeyValueStoreError | SchemaError, RD_co | RE_co]]

Replace a present value with f(value) and return it.

removeCallable[[str], Effect[None, KeyValueStoreError]]
clearEffect[None, KeyValueStoreError]
sizeEffect[int, KeyValueStoreError]
keysEffect[list[str], KeyValueStoreError]

A snapshot of the keys, in no particular order.

hasCallable[[str], Effect[bool, KeyValueStoreError]]
is_emptyEffect[bool, KeyValueStoreError]

Functions

__init__

__init__(*, get, set, modify, remove, clear, size, keys, has, is_empty) -> None
ParameterTypeDescription
getCallable[[str], Effect[Option[T], KeyValueStoreError | SchemaError, RD_co]]
setCallable[[str, T], Effect[None, KeyValueStoreError | SchemaError, RE_co]]
modifyCallable[[str, Callable[[T], T]], Effect[Option[T], KeyValueStoreError | SchemaError, RD_co | RE_co]]
removeCallable[[str], Effect[None, KeyValueStoreError]]
clearEffect[None, KeyValueStoreError]
sizeEffect[int, KeyValueStoreError]
keysEffect[list[str], KeyValueStoreError]
hasCallable[[str], Effect[bool, KeyValueStoreError]]
is_emptyEffect[bool, KeyValueStoreError]