2 releases
Uses new Rust 2024
| 0.2.2 | Oct 11, 2025 |
|---|---|
| 0.2.0 | Aug 6, 2025 |
#4 in #everyday
212 downloads per month
14KB
155 lines
toolcraft-utils
Common utilities and helper functions for the toolcraft ecosystem.
Features
- 🚀 Common utility functions for everyday use
- 🔧 Helper functions for the toolcraft ecosystem
- 🎯 Zero dependencies for core functionality
- ⚡ Performance-focused implementations
- 🧩 Modular design - use only what you need
Installation
Add this to your Cargo.toml:
[dependencies]
toolcraft-utils = "*"
Check the crates.io page for the latest version.
Quick Start
use toolcraft_utils::*;
fn main() {
// Utility functions will be available here
// This is a placeholder for future utilities
}
Planned Features
This crate is currently in early development. Planned utilities include:
String Utilities
- String manipulation helpers
- Case conversion utilities
- Text processing functions
File System Utilities
- Path manipulation helpers
- File reading/writing utilities
- Directory traversal helpers
Time Utilities
- Duration formatting
- Time calculation helpers
- Timestamp utilities
Data Structure Utilities
- Collection helpers
- Data transformation utilities
- Common algorithms
Error Handling Utilities
- Result combinators
- Error conversion helpers
- Retry mechanisms
Encoding Utilities
- Base64 encoding/decoding
- Hex encoding/decoding
- Hash utilities
Network Utilities
- URL parsing helpers
- IP address utilities
- Port validation
Validation Utilities
- Input validation helpers
- Format validators
- Range checks
Contributing
This crate is in early development and we welcome contributions! If you have ideas for useful utilities that would benefit the toolcraft ecosystem, please feel free to:
- Open an issue to discuss the utility
- Submit a pull request with your implementation
- Add comprehensive tests and documentation
Guidelines for New Utilities
When adding new utilities, please ensure:
- Zero or minimal dependencies: Keep the crate lightweight
- Comprehensive documentation: Include examples for each function
- Thorough testing: Add unit tests for all edge cases
- Performance considerations: Optimize for common use cases
- Ergonomic API: Make functions easy to use and discover
Example Structure (Future)
// String utilities
use toolcraft_utils::string::{to_snake_case, to_camel_case};
let snake = to_snake_case("HelloWorld"); // "hello_world"
let camel = to_camel_case("hello_world"); // "helloWorld"
// File utilities
use toolcraft_utils::fs::{ensure_dir, read_json};
ensure_dir("./config")?;
let config: MyConfig = read_json("./config/app.json")?;
// Time utilities
use toolcraft_utils::time::{format_duration, parse_duration};
let duration = parse_duration("1h 30m")?;
let formatted = format_duration(duration); // "1 hour 30 minutes"
// Validation utilities
use toolcraft_utils::validate::{is_valid_email, is_valid_url};
if is_valid_email("user@example.com") {
// Process email
}
Design Philosophy
- Simplicity: Each utility should do one thing well
- Composability: Utilities should work well together
- Performance: Optimize for the common case
- Safety: Prefer safe APIs, use unsafe only when necessary
- Clarity: Clear naming and obvious behavior
License
This project is licensed under the MIT License - see the LICENSE file for details.
Links
Dependencies
~3–5MB
~93K SLoC