objectiveai_api/ensemble/fetcher/
fetcher.rs

1//! Ensemble fetcher trait definition.
2
3use crate::ctx;
4
5/// Trait for fetching ensemble definitions by ID.
6#[async_trait::async_trait]
7pub trait Fetcher<CTXEXT> {
8    /// Fetches an ensemble by its ID.
9    ///
10    /// Returns `Ok(None)` if the ensemble is not found.
11    /// Returns the ensemble and its creation timestamp if found.
12    async fn fetch(
13        &self,
14        ctx: ctx::Context<CTXEXT>,
15        id: &str,
16    ) -> Result<
17        Option<(objectiveai::ensemble::Ensemble, u64)>,
18        objectiveai::error::ResponseError,
19    >;
20}