| Crates.io | batch-mode-batch-workspace-interface |
| lib.rs | batch-mode-batch-workspace-interface |
| version | 0.2.2 |
| created_at | 2025-02-27 05:41:34.915523+00 |
| updated_at | 2025-07-13 10:35:36.779871+00 |
| description | Defines traits for interacting with batch workspaces, including file paths and directories. |
| homepage | |
| repository | https://github.com/klebs6/klebs-general |
| max_upload_size | |
| id | 1571336 |
| size | 124,315 |
The batch-mode-batch-workspace-interface crate defines the set of traits that outline the operations for interacting with batch workspaces in a batch processing system. These traits cover operations related to file paths, workspace directories, token expansions, and file storage paths.
done, failed_json_repairs, failed_items, and text_storage.The BatchWorkspaceInterface trait bundles together all necessary operations for interacting with batch workspace files and directories. It includes the following individual traits:
To implement these traits, create a structure (like BatchWorkspace) that provides the necessary methods for accessing the batch workspace files and directories. For example:
use batch_mode_batch_workspace_interface::{BatchWorkspaceInterface, GetInputFilenameAtIndex};
struct MyBatchWorkspace {
workdir: PathBuf,
}
impl GetInputFilenameAtIndex for MyBatchWorkspace {
fn input_filename(&self, batch_idx: &BatchIndex) -> PathBuf {
self.workdir.join(format!("batch_input_{}.jsonl", batch_idx))
}
}
impl BatchWorkspaceInterface for MyBatchWorkspace {}
Once the interface is implemented, you can use it to access batch files and directories in the workspace:
let workspace = MyBatchWorkspace { workdir: "/path/to/workdir".into() };
let input_file = workspace.input_filename(&BatchIndex::Usize(1));
println!("Input file path: {:?}", input_file);
This crate is licensed under the MIT License. See LICENSE for details.