Radix.fetch
You're seeing just the function
fetch
, go back to Radix module for more information.
Specs
Fetches the key,value-pair for a specific key
in the given tree
.
Returns {:ok, {key, value}}
or :error when key
is not in the tree
.
Example
iex> t = new([{<<1>>, 1}, {<<1, 1>>, 2}])
iex> fetch(t, <<1, 1>>)
{:ok, {<<1, 1>>, 2}}
iex>
iex> fetch(t, <<2>>)
:error