Radix.fetch-exclamation-mark
You're seeing just the function
fetch-exclamation-mark
, go back to Radix module for more information.
Specs
Fetches the key,value-pair for a specific key
in the given tree
.
Returns the {key, value}
-pair itself, or raises a KeyError
if key
is
not in the tree
. By default an exact match is used, specify match: :lpm
to fetch based on a longest prefix match.
Example
iex> t = new([{<<1>>, 1}, {<<1, 1>>, 2}])
iex> fetch!(t, <<1, 1>>)
{<<1, 1>>, 2}
iex>
iex> fetch!(t, <<2>>)
** (KeyError) key not found <<0b10>>
iex>
iex> fetch!(t, <<1, 1, 1>>, match: :lpm)
{<<1, 1>>, 2}