batch_mode_batch_client/
check_and_download_interface.rs

1// ---------------- [ File: batch-mode-batch-client/src/check_and_download_interface.rs ]
2crate::ix!();
3
4#[async_trait]
5pub trait CheckAndDownloadInterface<E>:
6    CheckForAndDownloadOutputAndErrorOnline<E>
7    + CheckBatchStatusOnline<E>
8    + DownloadOutputFile<E>
9    + DownloadErrorFile<E>
10{
11}
12
13#[async_trait]
14pub trait CheckForAndDownloadOutputAndErrorOnline<E> {
15    async fn check_for_and_download_output_and_error_online(
16        &mut self,
17        client: &dyn LanguageModelClientInterface<E>,
18    ) -> Result<(), E>;
19}
20
21#[async_trait]
22pub trait CheckBatchStatusOnline<E> {
23    async fn check_batch_status_online(
24        &self,
25        client: &dyn LanguageModelClientInterface<E>,
26    ) -> Result<BatchOnlineStatus, E>;
27}
28
29#[async_trait]
30pub trait DownloadOutputFile<E> {
31    async fn download_output_file(
32        &mut self,
33        client: &dyn LanguageModelClientInterface<E>,
34    ) -> Result<(), E>;
35}
36
37#[async_trait]
38pub trait DownloadErrorFile<E> {
39    async fn download_error_file(
40        &mut self,
41        client: &dyn LanguageModelClientInterface<E>,
42    ) -> Result<(), E>;
43}
44
45// ----- The key fix: add a matching `impl<E>` block with the right bounds. -----
46
47#[async_trait]
48impl<E> CheckAndDownloadInterface<E> for BatchFileTriple
49where
50    E: From<BatchDownloadError>
51      + From<OpenAIClientError>
52      + From<BatchMetadataError>
53      + From<std::io::Error> 
54      + Debug
55      + Display,
56{
57    // We don’t need any methods here, because this trait 
58    // is just the aggregator of the 4 sub‐traits above.
59}