Radix.set

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

Specs

set(tree(), [keyval()]) :: tree()

Store {k, v}-pairs in the radix tree, any existing k's will have their v replaced.

Example

iex> elements = [{<<1, 1>>, "1.1.0.0/16"}, {<<1, 1, 1, 1>>, "x/y"}]
iex> new() |> set(elements)
{0,
  {23, [{<<1, 1>>, "1.1.0.0/16"}],
       [{<<1, 1, 1, 1>>, "x/y"}]},
  nil
}

Specs

set(tree(), key(), value()) :: tree()

Store a {k, v}-pair in the radix tree, an existing k will have its v replaced.

Example

iex> elements = [{<<1, 1>>, "1.1.0.0/16"}, {<<1, 1, 1, 1>>, "x.x.x.x"}]
iex> new(elements) |> set(<<1, 1, 1, 1>>, "1.1.1.1")
{0,
  {23, [{<<1, 1>>, "1.1.0.0/16"}],
       [{<<1, 1, 1, 1>>, "1.1.1.1"}]},
  nil
}