| Crates.io | batch-mode-batch-workspace |
| lib.rs | batch-mode-batch-workspace |
| version | 0.2.2 |
| created_at | 2025-02-27 05:55:21.102376+00 |
| updated_at | 2025-07-13 10:42:00.040169+00 |
| description | Manages batch processing workspaces, handling tasks like locating batch files, validating files, and managing batch indices. |
| homepage | |
| repository | https://github.com/klebs6/klebs-general |
| max_upload_size | |
| id | 1571366 |
| size | 246,216 |
The batch-mode-batch-workspace crate provides functionality for managing batch processing workspaces. It integrates with batch files and batch indices, handling tasks such as file validation, locating batch files, and gathering batch file triples. The crate also provides methods for interacting with files in the workspace, ensuring the correct structure for batch processing.
You can create a new workspace using one of the following methods:
use batch_mode_batch_workspace::BatchWorkspace;
let workspace = BatchWorkspace::new_temp().await?;
let workspace = BatchWorkspace::new_in("/path/to/workspace").await?;
To locate batch files for a specific batch index:
let batch_triple = workspace.locate_batch_files(&BatchIndex::Usize(4)).await?;
You can gather all batch triples in the workspace with:
let batch_files = workspace.gather_all_batch_triples().await?;
To ensure that input files match the corresponding output and error files:
batch_triple.ensure_input_matches_output().await?;
batch_triple.ensure_input_matches_error().await?;
batch_triple.ensure_input_matches_output_and_error().await?;
The crate defines custom error types for managing workspace and batch file errors:
BatchWorkspaceError: Errors encountered during batch workspace operations, such as file access or batch index issues.BatchValidationError: Errors when validating batch files, such as mismatched request IDs.FileMoveError: Errors encountered when moving files in the workspace.This crate is licensed under the MIT License. See LICENSE for details.