Radix.lookup
You're seeing just the function
lookup
, go back to Radix module for more information.
Specs
Get the key,value-pair whose key is the longest prefix of key
.
Example
iex> elms = [{<<1, 1>>, 16}, {<<1, 1, 0>>, 24}, {<<1, 1, 0, 0::1>>, 25}]
iex> t = new(elms)
iex> lookup(t, <<1, 1, 0, 127>>)
{<<1, 1, 0, 0::1>>, 25}
#
iex> lookup(t, <<1, 1, 0, 128>>)
{<<1, 1, 0>>, 24}
#
iex> lookup(t, <<1, 1, 1, 1>>)
{<<1, 1>>, 16}
#
iex> lookup(t, <<2, 2, 2, 2>>)
nil