scitadel-core 0.1.0

Core domain models, services, and ports for the scitadel scientific-literature retrieval toolkit.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use async_trait::async_trait;

use crate::error::CoreError;
use crate::models::CandidatePaper;

/// Port for external source adapters (`PubMed`, `arXiv`, `OpenAlex`, `INSPIRE`).
#[async_trait]
pub trait SourceAdapter: Send + Sync {
    /// Human-readable name of this source (e.g., "pubmed", "arxiv").
    fn name(&self) -> &str;

    /// Search the source and return normalized candidate records.
    async fn search(
        &self,
        query: &str,
        max_results: usize,
    ) -> Result<Vec<CandidatePaper>, CoreError>;
}