Iptrie.get

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

get(trie, prefix, default \\ nil)

View Source

Specs

get(t(), prefix(), any()) :: {prefix(), any()} | any()

Returns the prefix,value-pair stored under given prefix in trie, using an exact match.

If prefix is not found, default is returned. If default is not provided, nil is used.

Example

iex> ipt = new([{"1.1.1.0/30", "A"}, {"1.1.1.0/31", "B"}, {"1.1.1.0", "C"}])
iex>
iex> get(ipt, "1.1.1.0/31")
{"1.1.1.0/31", "B"}
iex>
iex> get(ipt, "2.2.2.0/30")
nil
iex> get(ipt, "2.2.2.0/30", :notfound)
:notfound