| Crates.io | batch-mode-batch-index |
| lib.rs | batch-mode-batch-index |
| version | 0.2.2 |
| created_at | 2025-02-27 05:31:57.018531+00 |
| updated_at | 2025-07-13 10:19:49.491587+00 |
| description | Provides utilities for managing batch indices and generating regex patterns for matching batch file names based on Usize or UUID identifiers. |
| homepage | |
| repository | https://github.com/klebs6/klebs-general |
| max_upload_size | |
| id | 1571334 |
| size | 112,072 |
This crate provides utilities for handling batch indices in a batch processing environment. It defines the BatchIndex type, which can be either a Usize or a Uuid, and provides mechanisms to generate regular expressions (regex) for matching batch-related filenames based on these indices. The crate ensures the consistent handling of batch identifiers and file patterns throughout the batch processing lifecycle.
Usize) or UUID-based identifiers.BatchIndex and BatchIndexType.use batch_mode_batch_index::{BatchIndex, BatchIndexType};
let batch_index = BatchIndex::Usize(4);
let regex = batch_index.file_pattern();
assert!(regex.is_match("batch_input_4.jsonl"));
assert!(!regex.is_match("batch_input_invalid.jsonl"));
BatchIndex and BatchIndexTypelet index_type = BatchIndexType::from(&batch_index);
The crate defines errors for UUID parsing, ensuring proper validation and handling of batch index values.
This crate is licensed under the MIT License. See LICENSE for details.