dnsjit.lib.trie.iter(3)
π dnsjit.lib.trie.iter β it's giving iterator energy π
okay bestie, this is the dnsjit.lib.trie.iter manual page, part of the dnsjit Library Functions Manual (section 3, library calls, iykyk). It's all about iterating over a trie. Let's get into it π¦
β¨ NAME β¨
dnsjit.lib.trie.iter β the Iterator of the trie. that's it, that's the whole vibe π
πΈ SYNOPSIS πΈ
π Iterate over all trie's key-value pairs
local trie = require("dnsjit.lib.trie").new("uint64_t")
local iter = trie:iter()
local node = iter:node()
while node ~= nil do
local key = node:key()
local value = tonumber(node:get())
print(key..": "..value)
iter:next()
node = iter:node()
end
literally the cutest little while loop you ever did see π«Ά
π DESCRIPTION π
β οΈ BEWARE BESTIE. The iterator is only valid as long as the trie's key-set remains unchanged. Do not be out here changing keys mid-iteration, that's not the move π
π§ Functions
TrieIter.new(trie)β creates a brand new iterator, and it's pointing at the first element (if there even is one β if the trie is empty, well, nothing to point at π).TrieIter:log()β hands you back theLogobject so you can control logging for this instance or module. very demure, very mindful β¨TrieIter:node()β returns the node pointer that the iterator is currently pointing at. Returnsnilwhen the iterator has gone past the last element. so if you getnil, you've officially left the building πTrieIter:next()β advances the iterator to the next element. iconic behavior π
Iteration happens in ascending lexicographical order. And the empty string is considered the very first one. yes queen, empty string gets the front-row seat ποΈ
π¨ You may not use this function if the trie's key-set has been modified during the lifetime of the iterator. Modifying only values is OK though. So: values, yes π keys, absolutely not π ββοΈ
π SEE ALSO π
go read your sisters, they're slaying too π
π AUTHORS and CONTRIBUTORS π
The absolute legends who made this happen:
- Jerry LundstrΓΆm (DNS-OARC)
- TomΓ‘Ε‘ KΕΓΕΎek (CZ.NIC)
- Petr Ε paΔek (ISC)
Maintained by DNS-OARC
https://www.dns-oarc.net/
the way they maintain this fr fr π«Ά
π BUGS π
Found something broken? Got a feature request? (periodt, we love those π ) Use:
https://codeberg.org/DNS-OARC/dnsjit/issues
Got a question, or just need a little help? Hit up:
admin@dns-oarc.net
and that's the whole page bestie, no notes, you're gonna iterate like a pro πβ¨ππ¦πΈ
this has been dnsjit.lib.trie.iter(3), from the dnsjit Library Functions Manual β source dnsjit, version 1.5.1 β go forth and iterate, mwah π
π¦ where this page comes from
- epel 10: dnsjit 1.5.1-2.el10_2 Β· GPL-3.0-or-later
- epel 9: dnsjit 1.5.1-2.el9 Β· GPL-3.0-or-later
- fedora 43: dnsjit 1.5.1-2.fc43 Β· GPL-3.0-or-later
- fedora 43: dnsjit 1.5.1-2.fc43 Β· GPL-3.0-or-later
- fedora 44: dnsjit 1.5.1-2.fc44 Β· GPL-3.0-or-later
- fedora 44: dnsjit 1.5.1-2.fc44 Β· GPL-3.0-or-later
- ubuntu resolute: dnsjit 1.5.1-2 Β· GPL-3.0-or-later
- ubuntu stonking: dnsjit-dev 1.5.1-6 Β· GPL-3.0-or-later
- Copyright (c) 2018-2026 OARC, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms