Skip to main content

synwire_core/loaders/
traits.rs

1//! Document loader trait definition.
2
3use crate::BoxFuture;
4use crate::documents::Document;
5use crate::error::SynwireError;
6
7/// Trait for document loaders.
8///
9/// A loader reads documents from an external source (file, URL, database, etc.)
10/// and returns them as a `Vec<Document>`.
11pub trait DocumentLoader: Send + Sync {
12    /// Load documents from the source.
13    fn load(&self) -> BoxFuture<'_, Result<Vec<Document>, SynwireError>>;
14}