Radix.more
You're seeing just the function
more
, go back to Radix module for more information.
Specs
Returns all key,value-pairs where the given search key
is a prefix for a stored key.
Collects key,value-pairs where the stored key is the same or more specific.
Example
iex> elements = [
...> {<<1, 1>>, 16},
...> {<<1, 1, 0>>, 24},
...> {<<1, 1, 0, 0>>, 32},
...> {<<1, 1, 1, 1>>, 32}
...> ]
iex> t = new(elements)
iex> more(t, <<1, 1, 0>>)
[{<<1, 1, 0, 0>>, 32}, {<<1, 1, 0>>, 24}]
iex> more(t, <<1, 1, 1>>)
[{<<1, 1, 1, 1>>, 32}]
iex> more(t, <<2>>)
[]
#
# exclusive search for more specifics
#
iex> more(t, <<1, 1, 0>>, exclude: true)
[{<<1, 1, 0, 0>>, 32}]
#
# search key itself does not have to exist
#
iex> more(t, <<1>>)
[{<<1, 1, 1, 1>>, 32}, {<<1, 1, 0, 0>>, 32}, {<<1, 1, 0>>, 24}, {<<1, 1>>, 16}]