MST.Store.Memory
(mst v0.1.0)
View Source
Map-backed in-memory MST node store.
Suitable for tests and any use case where the full tree fits in memory.
The store state is a plain %{} map from DASL.CID to MST.Node.
Usage
store = MST.Store.Memory.new()
tree = MST.Tree.new(store)
Summary
Types
@type state() :: %{required(DASL.CID.t()) => MST.Node.t()}
Functions
@spec new() :: MST.Store.t()
Returns a new, empty memory store as a {MST.Store.Memory, %{}} pair.
Examples
iex> {mod, state} = MST.Store.Memory.new()
iex> mod
MST.Store.Memory
iex> state
%{}