RSBatch Maestro
A Rust crate for flexible batch splitting and management with various strategies.
Features
- Even and uneven splitting of totals into batches
- Splitting by count, with remainder, or based on weights
- Range-based splitting and optimization
- Minimum batch size enforcement
- Batch merging and rebalancing
- Handles edge cases and provides meaningful errors
Installation
Add this to your Cargo.toml:
[]
= "0.2.0"
Usage
use even_split;
API
The crate provides the following functions:
For detailed documentation on each function, please refer to the API documentation.
Examples
use *;
use NonZeroUsize;
// Even split
assert_eq!;
// Uneven split
assert_eq!;
// Split by count
assert_eq!;
// Split with remainder
assert_eq!;
// Split weighted
assert_eq!;
// More examples for other functions can be found in the API documentation
Use Cases
Batch Maestro is versatile and can be applied to various scenarios:
- Task Distribution: Distribute tasks among workers in parallel processing systems.
- Load Balancing: Distribute network traffic or database queries across multiple servers.
- Resource Allocation: Allocate resources (e.g., memory, disk space) across different processes or users.
- Inventory Management: Divide inventory items across different storage locations or shipments.
- Time Management: Split a total time duration into segments for schedules or timetables.
- Financial Applications: Divide sums of money for budgeting or investment purposes.
- Data Partitioning: Partition large datasets for distributed processing or storage.
- Batch Processing: Create batches for any kind of batch processing operation.
- UI/UX Design: Distribute elements in user interfaces, such as grid layouts or menu items.
- Educational Applications: Create groups of students for group projects or activities.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Please make sure to update tests as appropriate.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
- aeromilai - Initial work - aeromilai
See also the list of contributors who participated in this project.
Acknowledgements
- Inspired by the need for efficient and flexible resource distribution in various domains.
- Thanks to the Rust community for providing excellent tools and libraries.
Changelog
For details on our releases, see the Changelog.