pub struct CodeIndexer { /* private fields */ }Expand description
Orchestrates code indexing over a project tree.
CodeIndexer is the primary driver of the indexing pipeline. It walks the file
tree, delegates per-file work to FileIndexWorker, and coordinates the Qdrant +
SQLite writes via CodeStore.
§Cloning and concurrency
CodeIndexer is not Clone — it is typically wrapped in an Arc and shared
between the initial indexing task and the file watcher.
§Examples
use std::sync::Arc;
use zeph_index::indexer::{CodeIndexer, IndexerConfig};
use zeph_index::store::CodeStore;
let indexer = CodeIndexer::new(store, provider, IndexerConfig::default());
let report = indexer.index_project(std::path::Path::new("."), None).await?;
println!("indexed {} files in {}ms", report.files_indexed, report.duration_ms);Implementations§
Source§impl CodeIndexer
impl CodeIndexer
Sourcepub fn new(
store: CodeStore,
provider: Arc<AnyProvider>,
config: IndexerConfig,
) -> Self
pub fn new( store: CodeStore, provider: Arc<AnyProvider>, config: IndexerConfig, ) -> Self
Create a new CodeIndexer.
The store and provider are cloned cheaply (reference-counted) across
the concurrent file-processing tasks.
Sourcepub fn with_spawner(self, spawner: Arc<dyn BlockingSpawner>) -> Self
pub fn with_spawner(self, spawner: Arc<dyn BlockingSpawner>) -> Self
Attach a supervised blocking spawner for chunk_file tasks.
When set, each chunk_file call is routed through the spawner so it is
visible in supervisor snapshots and subject to graceful shutdown.
§Examples
use std::sync::Arc;
use zeph_index::indexer::{CodeIndexer, IndexerConfig};
use zeph_index::store::CodeStore;
use zeph_common::BlockingSpawner;
let indexer = CodeIndexer::new(store, provider, IndexerConfig::default())
.with_spawner(spawner);Sourcepub async fn index_project(
&self,
root: &Path,
progress_tx: Option<&Sender<IndexProgress>>,
) -> Result<IndexReport>
pub async fn index_project( &self, root: &Path, progress_tx: Option<&Sender<IndexProgress>>, ) -> Result<IndexReport>
Full project indexing with incremental change detection.
§Errors
Returns an error if the embedding probe or collection setup fails.
Auto Trait Implementations§
impl !RefUnwindSafe for CodeIndexer
impl !UnwindSafe for CodeIndexer
impl Freeze for CodeIndexer
impl Send for CodeIndexer
impl Sync for CodeIndexer
impl Unpin for CodeIndexer
impl UnsafeUnpin for CodeIndexer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request