Packages
cubdb
1.0.0-rc.10
2.0.2
2.0.1
2.0.0
2.0.0-rc.1
1.1.0
1.0.0
1.0.0-rc.10
1.0.0-rc.9
1.0.0-rc.8
1.0.0-rc.7
1.0.0-rc.6
1.0.0-rc.5
1.0.0-rc.4
1.0.0-rc.3
1.0.0-rc.2
1.0.0-rc.1
0.17.0
0.16.4
0.16.3
0.16.2
0.16.1
0.16.0
0.15.0
0.14.0
0.13.1
0.13.0
0.12.0
0.11.0
0.10.0
0.9.0
0.8.0
0.7.0
0.6.0
0.5.0
0.4.0
0.3.0
0.2.0
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
A pure-Elixir embedded key-value database
Current section
Files
Jump to
Current section
Files
lib/cubdb/store.ex
defprotocol CubDB.Store do
@moduledoc false
# The `CubDB.Store` protocol defines the storage interface for CubDB. It
# provides functions to read and write nodes and headers, locate the latest
# header, and managing durability.
alias CubDB.Btree
@spec put_node(t, Btree.btree_node()) :: Btree.location()
def put_node(store, node)
@spec put_header(t, Btree.btree_header()) :: Btree.location()
def put_header(store, header)
@spec sync(t) :: :ok | {:error, String.t()}
def sync(store)
@spec get_node(t, Btree.location()) :: Btree.btree_node() | {:error, String.t()}
def get_node(store, location)
@spec get_latest_header(t) :: {Btree.location(), Btree.btree_header()} | nil
def get_latest_header(store)
@spec close(t) :: :ok | {:error, String.t()}
def close(store)
@spec blank?(t) :: boolean
def blank?(store)
@spec open?(t) :: boolean
def open?(store)
end