Iptrie.put
You're seeing just the function
put
, go back to Iptrie module for more information.
Specs
Puts the prefix,value-pairs in elements
into trie
.
This always uses an exact match for prefix, updating its value if it exists.
Example
iex> ipt = new()
...> |> put([{"1.1.1.0/24", 0}, {"1.1.1.1", 0}, {"1.1.1.1", "x"}])
iex>
iex> get(ipt, "1.1.1.1")
{"1.1.1.1", "x"}
Specs
Puts value
under prefix
in trie
.
This always uses an exact match for prefix
, replacing its value if it
exists.
Example
iex> ipt = new()
...> |> put("1.1.1.0/24", 0)
...> |> put("1.1.1.1", 1)
...> |> put("1.1.1.1", "x")
iex>
iex> get(ipt, "1.1.1.1")
{"1.1.1.1", "x"}