Radix.walk

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

walk(tree, acc, fun, order \\ :inorder)

View Source

Specs

walk(tree(), acc(), (acc(), tree() | leaf() -> acc()), atom()) :: acc()

Invokes fun on all (internal and leaf) nodes of the radix tree using either :inorder, :preorder or :postorder traversal.

fun should have the signatures:

Note that leaf/0 might be nil.

Example

iex> t = new([{<<1>>, 1}, {<<2>>, 2}, {<<3>>, 3}, {<<128>>, 128}])
iex> f = fn
...>   (acc, {_bit, _left, _right}) -> acc
...>   (acc, nil) -> acc
...>   (acc, leaf) -> acc ++ Enum.map(leaf, fn {_k, v} -> v end)
...> end
iex> walk(t, [], f)
[1, 2, 3, 128]