Radix.less

You're seeing just the function less, go back to Radix module for more information.
Link to this function

less(tree, key, opts \\ [])

View Source

Specs

less(tree(), key(), Keyword.t()) :: [{key(), value()}]

Returns all key,value-pairs whose key is a prefix for the given search key.

Collects key,value-pairs where the stored key is the same or less specific. Optionally exclude the search key from the results by providing option :exclude as true.

Example

# include search for less specifics
iex> elements = [
...>  {<<1, 1>>, 16},
...>  {<<1, 1, 0>>, 24},
...>  {<<1, 1, 0, 0>>, 32},
...>  {<<1, 1, 1, 1>>, 32}
...> ]
iex> t = new(elements)
iex> less(t, <<1, 1, 1, 1>>)
[{<<1, 1, 1, 1>>, 32}, {<<1, 1>>, 16}]
iex> less(t, <<1, 1, 0>>)
[{<<1, 1, 0>>, 24}, {<<1, 1>>, 16}]
iex> less(t, <<2, 2>>)
[]
#
# exclusive search for less specifics
#
iex> less(t, <<1, 1, 0, 0>>, exclude: true)
[{<<1, 1, 0>>, 24}, {<<1, 1>>, 16}]
#
# search key itself does not have to exist in the tree
iex> less(t, <<1, 1, 0, 25>>)
[{<<1, 1, 0>>, 24}, {<<1, 1>>, 16}]