batch_mode_batch_workspace/
full_batch_workspace_interface.rs

1// ---------------- [ File: batch-mode-batch-workspace/src/full_batch_workspace_interface.rs ]
2crate::ix!();
3
4#[async_trait]
5pub trait FullBatchWorkspaceInterface<E,I>:
6    BatchWorkspaceInterface
7    + CalculateUnseenInputs<I>
8    + LocateBatchFiles<Error=E>
9    + FindExistingBatchFileIndices<Error=E>
10    + GatherAllBatchTriples<Error=E>
11    + Send
12    + Sync
13    where I: GetTargetPathForAIExpansion + Clone + Debug + Display + Named,
14{
15}
16
17#[async_trait]
18impl<T,E,I> FullBatchWorkspaceInterface<E,I> for T
19where
20    T: BatchWorkspaceInterface
21        + CalculateUnseenInputs<I>
22        + LocateBatchFiles<Error=E>
23        + FindExistingBatchFileIndices<Error=E>
24        + GatherAllBatchTriples<Error=E>
25        + Send
26        + Sync,
27    I: GetTargetPathForAIExpansion + Clone + Debug + Display + Named,
28{
29}
30
31#[async_trait]
32pub trait GatherAllBatchTriples: Send + Sync 
33{
34    type Error;
35    async fn gather_all_batch_triples(
36        self: Arc<Self>,
37    ) -> Result<Vec<BatchFileTriple>, Self::Error>;
38}
39
40#[async_trait]
41pub trait FindExistingBatchFileIndices: Send + Sync {
42    type Error;
43    async fn find_existing_batch_file_indices(
44        self: Arc<Self>,
45    ) -> Result<HashSet<BatchIndex>, Self::Error>;
46}
47
48#[async_trait]
49pub trait LocateBatchFiles: Send + Sync {
50    type Error;
51    async fn locate_batch_files(
52        self: Arc<Self>,
53        index: &BatchIndex
54    ) -> Result<Option<BatchFileTriple>, Self::Error>;
55}
56
57pub trait GetBatchWorkspace<E,I> 
58    where I: GetTargetPathForAIExpansion + Clone + Debug + Display + Named,
59{
60    fn workspace(&self) -> Arc<dyn FullBatchWorkspaceInterface<E,I>>;
61}