Iptrie.find-exclamation-mark
You're seeing just the function
find-exclamation-mark
, go back to Iptrie module for more information.
Specs
Finds a prefix,value-pair for given prefix
from trie
(longest match).
In case of success, returns {prefix, value}.
If prefix
had no match, raises a KeyError
.
If prefix
could not be encoded, raises an ArgumentError
.
Example
iex> ipt = new()
...> |> put("10.10.10.0/24", "ten")
...> |> put("11.11.11.0/24", "eleven")
iex>
iex> find!(ipt, "10.10.10.0/24")
{"10.10.10.0/24", "ten"}
iex>
iex> find!(ipt, "12.12.12.12")
** (KeyError) prefix "12.12.12.12" not found
iex> ipt = new()
iex> find!(ipt, "13.13.13.333")
** (ArgumentError) invalid prefix "13.13.13.333"