use std::{
fmt::Debug,
path::{Path, PathBuf},
sync::Arc,
};
#[cfg(test)]
use mockall::{automock, predicate::*};
use crate::indexer;
#[allow(missing_docs)]
pub type Result<T> = std::result::Result<T, indexer::Error>;
#[cfg_attr(test, automock)]
pub trait Indexer: Send + Sync + Debug {
fn get_workspaces(&self) -> Vec<Arc<PathBuf>>;
fn is_inside_workspace(&self, path: &Path) -> bool;
fn index_workspaces(
&self,
) -> impl Future<Output = std::result::Result<(), Vec<indexer::Error>>> + Send;
fn index(&self, path: &Path) -> impl Future<Output = Result<()>> + Send;
fn deindex(&self, path: &Path) -> impl Future<Output = Result<()>> + Send;
}