HashCKeyspace[K: Any val, V: (Convergent[V] ref & Replicated ref), H: HashFunction[K] val]¶
A keyed collection of convergent CRDTs sharing a causal context. Each key
maps to an instance of V, created on demand via at. All values share the
same DotContext, enabling coordinated causal tracking across keys.
Convergence merges entries key-by-key, creating local entries for keys that exist only in the remote state.
class ref HashCKeyspace[K: Any val, V: (Convergent[V] ref & Replicated ref), H: HashFunction[K] val]
Constructors¶
create¶
Parameters¶
- id: ID
Returns¶
- HashCKeyspace[K, V, H] ref^
Public Functions¶
is_empty¶
Returns¶
- Bool val
size¶
Returns¶
- USize val
keys¶
Returns¶
- Iterator[this->K] ref^
values¶
Returns¶
- Iterator[this->V] ref^
pairs¶
Returns¶
- Iterator[(this->K , this->V)] ref^
apply¶
Parameters¶
- k: box->K!
Returns¶
- this->V ?
at¶
Parameters¶
- k: box->K!
Returns¶
- V
converge¶
Merge state from that keyspace into this one. Returns true if the convergence added new information.
Parameters¶
- that: HashCKeyspace[K, V, H] box
Returns¶
- Bool val
string¶
Return a best effort at printing the map. If K and V are Stringable, use string representations of them; otherwise print them as question marks.
Returns¶
- String iso^
from_tokens¶
Deserialize an instance of this data structure from a stream of tokens.
Parameters¶
- that: TokensIterator ref
Returns¶
- None val ?
each_token¶
Serialize the data structure, capturing each token into the given Tokens.
Parameters¶
- tokens: Tokens ref
Returns¶
- None val
each_token_of_history¶
Serialize the causal history, capturing each token into the given Tokens.
Parameters¶
- tokens: Tokens ref
Returns¶
- None val
compare_history_with_tokens¶
Compare the causal context with that represented by the given token stream. Raises an error if the tokens couldn't be parsed as a causal context. Returns two boolean values, representing differences that are present. The first return value is true if this context has dots missing in that one. The other return value is true if that context has dots missing in this one.
Parameters¶
- that: TokensIterator ref