use std::future::Future;
use kalosm_model_types::ModelLoadingProgress;
pub trait ModelBuilder {
type Model;
type Error: Send + Sync + 'static;
fn start(self) -> impl Future<Output = Result<Self::Model, Self::Error>>
where
Self: Sized,
{
async { self.start_with_loading_handler(|_| {}).await }
}
fn start_with_loading_handler(
self,
handler: impl FnMut(ModelLoadingProgress) + Send + Sync + 'static,
) -> impl Future<Output = Result<Self::Model, Self::Error>>
where
Self: Sized;
fn requires_download(&self) -> bool {
false
}
}