saealib.core.StateStore#
- class saealib.core.StateStore(initial=None, *, generation=0)[ソース]#
ベースクラス:
objectOwn versioned state values and consume each instance after a move.
- パラメータ:
initial (Mapping[StateKey, object] | None)
generation (int)
Methods
Apply |
|
Return whether |
|
Return the value for |
|
Create a read-only view limited to the supplied declared keys. |
Method Details
- StateStore.__init__(initial=None, *, generation=0)[ソース]#
- パラメータ:
initial (Mapping[StateKey, object] | None)
generation (int)
- 戻り値の型:
None
- StateStore.apply_patch(patch)[ソース]#
Apply
patchand return the new store, consuming this store.All update kinds, targets, and
PopulationRowUpdateoperations are validated against shadow populations before any owned value is changed. If preflight fails, this store remains live and its values are unchanged. After successful preflight, the operations are committed in write order and this store is consumed.- パラメータ:
patch (StatePatch)
- 戻り値の型:
- StateStore.contains(key)[ソース]#
Return whether
keyis present in this store.- パラメータ:
key (StateKey)
- 戻り値の型:
bool
- StateStore.get(key)[ソース]#
Return the value for
keyor raiseKeyErrorif absent.- パラメータ:
key (StateKey[ValueT])
- 戻り値の型:
ValueT
- StateStore.view(reads, *, context=None, dispatch=None)[ソース]#
Create a read-only view limited to the supplied declared keys.
- パラメータ:
reads (Iterable[StateKey] | StateContract)
context (object | None)
dispatch (Callable[[object], None] | None)
- 戻り値の型: