Iptrie.more

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

more(trie, prefix, opts \\ [])

View Source

Specs

more(t(), prefix(), Keyword.t()) :: [{prefix(), any()}]

Returns all the prefix,value-pairs where the search prefix is a prefix for the stored prefix.

This returns the more specific entries that are enclosed by given search prefix. Note that any bitstring is always a prefix of itself. So, unless the option :exclude is set to true the search key, if present, will be included in the results. Any other value for :exclude is ignored, which means the default action is to include the search key (if present).

Example

iex> ipt = new()
...> |> put("1.1.1.0/25", "A25-lower")
...> |> put("1.1.1.128/25", "A25-upper")
...> |> put("1.1.1.0/30", "A30")
...> |> put("1.1.1.0/24", "A24")
iex>
iex> more(ipt, "1.1.1.0/24")
[
  {"1.1.1.0/30", "A30"},
  {"1.1.1.0/25", "A25-lower"},
  {"1.1.1.0/24", "A24"},
  {"1.1.1.128/25", "A25-upper"}
]
#
# exclusive search
#
iex> more(ipt, "1.1.1.0/24", exclude: true)
[
  {"1.1.1.0/30", "A30"},
  {"1.1.1.0/25", "A25-lower"},
  {"1.1.1.128/25", "A25-upper"}
]