use crate::error::ServiceResult;
use crate::traits::CodeAnalyzer;
#[cfg(feature = "storage-traits")]
use crate::traits::StorageService;
use crate::types::ParsedDocument;
use std::path::Path;
use std::sync::Arc;
pub struct ThreadService<A: CodeAnalyzer<D>, D: crate::types::Doc + Send + Sync> {
#[allow(dead_code)]
analyzer: Arc<A>,
#[allow(dead_code)]
#[cfg(feature = "storage-traits")]
storage: Option<Arc<dyn StorageService>>,
_marker: std::marker::PhantomData<D>,
}
impl<A: CodeAnalyzer<D>, D: crate::types::Doc + Send + Sync> ThreadService<A, D> {
#[cfg(feature = "storage-traits")]
pub fn new(analyzer: Arc<A>, storage: Option<Arc<dyn StorageService>>) -> Self {
Self {
analyzer,
storage,
_marker: std::marker::PhantomData,
}
}
#[cfg(not(feature = "storage-traits"))]
pub fn new(analyzer: Arc<A>) -> Self {
Self {
analyzer,
_marker: std::marker::PhantomData,
}
}
pub async fn analyze_path(&self, _path: &Path) -> ServiceResult<Vec<ParsedDocument<D>>> {
Ok(vec![])
}
}