Design the architecture of the Tor metrics library in rust
Need to design a rust package to parse Tor network documents in rust.
Requirements:
- Functionality: Provide crates to parse Tor network documents in rust. Should support all the different documents type that we publish in collector and have feature parity with the current Java library.
- Input/Output: The package should accept Tor network document, parse the different fields and store results in a DB or in a tabular format like csv or parquet files.
- Error Handling: Robust error handling should be implemented using Rust's Result and Option types, ensuring graceful handling of edge cases.
- Performance: The package must be optimized for performance, especially for handling large datasets or high-frequency operations.
- Concurrency (optional): Consideration should be given to using Rust’s async/await and concurrency features if applicable.
Structure:
- Modules: Split the functionality into logical modules to improve maintainability and readability. Modules could include:
- core - containing the core logic
- utils - helper functions
- io - for input/output operations
- Testing: Unit tests should be included to verify correctness. Consider integration tests if applicable.
Documentation:
- The package should include documentation with examples of how to use the package. The doc comments should be formatted properly for Rust’s built-in documentation tools.
Dependencies:
- Consider dependencies that can simplify the implementation or improve functionality (e.g., serde for serialization, tokio for async, etc.), but avoid unnecessary bloat.
This issue should be used to plan the development of the package and build its structure. The actual coding should happen in separated issues.
Edited by Hiro