2.12.ipv8.dht.trie
Module Contents
Classes
Attributes
- 2.12.ipv8.dht.trie.NullType
- 2.12.ipv8.dht.trie.Null
- 2.12.ipv8.dht.trie.ValueType
- class 2.12.ipv8.dht.trie.Node
Bases:
Generic
[ValueType
]This class represents a node within a prefix tree.
- class 2.12.ipv8.dht.trie.Trie(alphabet: str)
Bases:
Generic
[ValueType
]This class represents a prefix tree.
- itervalues() Iterator[ValueType]
Iterate over all stored values.
- longest_prefix_item(key: str, default: tuple[str, ValueType] | NullType = Null) tuple[str, ValueType]
Get longest matching prefix, for the given key, and its value.
Raises a KeyError if no node is found at all.
- longest_prefix(key: str, default: str | NullType = Null) str
Get longest matching prefix, for the given key.
Raises a KeyError if no node is found at all.