Port HeroLib RadixTree Package from V to Rust #2
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Port HeroLib RadixTree Package from V to Rust
Overview
This issue involves porting the
radixtree
package from the HeroLib V codebase to a Rust implementation. The radixtree package provides a persistent radix tree data structure that uses OurDB as a backend storage system. The port should maintain all existing functionality while leveraging Rust's memory safety, performance, and ecosystem.Note: OurDB has already been ported to Rust and is available at git.ourworld.tf/herocode/db/ourdb. This implementation should be used as the storage backend for the RadixTree port.
What is a Radix Tree?
A radix tree (also known as a patricia trie or radix trie) is a space-optimized tree data structure that enables efficient string key operations. Unlike a standard trie where each node represents a single character, a radix tree compresses paths by allowing nodes to represent multiple characters (key segments).
Key characteristics:
Current Implementation Details
Core Data Structures
The V implementation consists of these primary structures:
Key Operations
The current implementation provides these core operations:
Persistence Layer
The current implementation uses OurDB for persistence:
The serialization format is:
Where each child is stored as:
Implementation Details
Node Operations
Insertion (set)
Search (get)
Prefix Search (list)
Deletion (delete)
Performance Characteristics
Requirements for Rust Port
The Rust implementation should:
Proposed Rust Structure
Implementation Considerations
Storage Backend:
Serialization:
Error Handling:
Memory Management:
Concurrency:
Use Cases
The radix tree implementation is particularly useful for:
Acceptance Criteria
Resources
github/freeflowuniverse/herolib/lib/data/radixtree
architecture specified:
ad29dbfd52
tests and examples for test driven dev set:
e62e0a125a