Author's bio: ๐๐ Hi, I'm CryptoPatrick! I'm currently enrolled as an Undergraduate student in Mathematics, at Chalmers & the University of Gothenburg, Sweden. If you have any questions or need more info, then please join my Discord Channel: AiMath
๐ Important Notices
- Curated Knowledge: Compiled rules of thumb for choosing the right data structures, algorithms, and patterns
- Searchable Database: Quickly find relevant heuristics by keywords, crates, or categories
- Rust-Focused: Specific recommendations for Rust crates and standard library types
๐ค What is heuristics
heuristics is a comprehensive Rust library that provides a searchable collection of computer science and Rust development heuristics. It helps developers make informed decisions about data structures, algorithms, and architectural patterns by providing curated rules of thumb with concrete recommendations.
The library enables quick discovery of the right tool for the job, whether you need O(1) lookups, persistent storage, concurrent data structures, or specialized algorithms.
Use Cases
- Architecture Decisions: Quickly find the right data structure or pattern for your use case
- Performance Optimization: Discover performance-oriented alternatives to common patterns
- Learning Resource: Understand when to use different Rust crates and standard library types
- Code Review: Reference best practices and implementation patterns
- Rapid Prototyping: Get up to speed quickly with recommended crates for specific scenarios
๐ท Features
heuristics provides a fast, searchable database of development heuristics with rich metadata and multiple access patterns.
๐ง Core Functionality
- Heuristic Loading: Parse and load heuristics from markdown format
- Keyword Search: Find relevant heuristics by searching keywords
- Category Browsing: Explore heuristics by category
- Rich Metadata: Access titles, actions, crates, standard types, and keywords
๐ Searchable Database
- Inverted Index: Fast keyword lookup using inverted index
- Relevance Ranking: Results ranked by number of keyword matches
- Partial Matching: Finds results even with partial keyword matches
- Case-Insensitive: Search works regardless of case
๐ Categorization
- Organized Topics: Heuristics grouped into logical categories
- Multiple Categories: Performance, concurrency, persistence, specialized data structures, and more
- Easy Navigation: Browse all heuristics within a specific category
- Category Listing: Get all available categories
๐ค Rust-Specific
- Crate Recommendations: Specific Rust crates for each use case
- Standard Library: Links to relevant std types (HashMap, Vec, etc.)
- Code Examples: Practical examples in Rust
- Best Practices: Rust-specific implementation patterns
๐ How to Use
Installation
Add heuristics to your Cargo.toml:
[]
= "0.1"
Or install with cargo:
Basic Example
use load_heuristics;
Advanced Usage
use *;
Command-Line Interface
The crate also includes a CLI tool:
# Install the binary
# Search for heuristics
# List all categories
# Get heuristics in a category
๐งช Testing
The test suite includes comprehensive coverage of search, categorization, and data structure functionality.
# Run all tests
# Run library tests only
# Run integration tests
# Run with output
Test coverage includes:
- Loading heuristics from base.md
- Keyword search (basic, multi-keyword, case-insensitive)
- Category listing and filtering
- Data structure validation
- Search ranking
- Edge cases (no results, empty searches)
๐ Documentation
Comprehensive documentation is available at docs.rs/heuristics, including:
- API reference for all public types and functions
- Examples of searching and browsing heuristics
- Heuristic data structure details
- Performance considerations and indexing strategy
๐ Author
CryptoPatrick
Keybase Verification: https://keybase.io/cryptopatrick/sigs/8epNh5h2FtIX1UNNmf8YQ-k33M8J-Md4LnAN
๐ฃ Support
Leave a โญ if you think this project is cool.
๐ License
This project is licensed under MIT. See LICENSE for details.