pub struct SourceIndex { /* private fields */ }Implementations§
Source§impl SourceIndex
impl SourceIndex
pub fn from_source( source_path_or_git_url: &str, include_text_files: bool, ) -> Result<Self>
pub fn from_source_bm25( source_path_or_git_url: &str, include_text_files: bool, ) -> Result<Self>
pub fn from_source_semantic( source_path_or_git_url: &str, include_text_files: bool, ) -> Result<Self, SemanticIndexBuildError>
pub fn from_path( path: impl AsRef<Path>, include_text_files: bool, ) -> Result<Self>
pub fn from_path_bm25( path: impl AsRef<Path>, include_text_files: bool, ) -> Result<Self>
Sourcepub fn from_path_bm25_uncached(
path: impl AsRef<Path>,
include_text_files: bool,
) -> Result<Self>
pub fn from_path_bm25_uncached( path: impl AsRef<Path>, include_text_files: bool, ) -> Result<Self>
Build a BM25/exact index without using the user-home source index cache.
ASR uses this path so agent-facing commands do not write outside ASR_HOME and do not mutate or depend on repository-local generated state.
Sourcepub fn from_chunks_bm25(chunks: Vec<Chunk>) -> Result<Self>
pub fn from_chunks_bm25(chunks: Vec<Chunk>) -> Result<Self>
Build a BM25/exact index from a persisted ASR chunk snapshot.
This constructor is lexical-only by design. It lets asr search query the
chunks produced by asr repo index without reading an arbitrary path from
the CLI and without requiring semantic model files.
pub fn from_git( url: &str, ref_: Option<&str>, include_text_files: bool, ) -> Result<Self>
pub fn search( &self, query: &str, top_k: usize, alpha: Option<f64>, filter_languages: Option<&[String]>, filter_paths: Option<&[String]>, ) -> Vec<SearchResult>
pub fn stats(&self) -> IndexStats
pub fn chunks(&self) -> &[Chunk]
pub fn graph(&self) -> &DependencyGraph
pub fn chunk_at(&self, file_path: &str, line: usize) -> Option<&Chunk>
Auto Trait Implementations§
impl Freeze for SourceIndex
impl RefUnwindSafe for SourceIndex
impl Send for SourceIndex
impl Sync for SourceIndex
impl Unpin for SourceIndex
impl UnsafeUnpin for SourceIndex
impl UnwindSafe for SourceIndex
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more