pub struct Index { /* private fields */ }Expand description
High-level handle to a Tessera index. Holds a single SQLite connection and, when present, a memory-mapped snapshot for hot-path queries.
Implementations§
Source§impl Index
impl Index
Sourcepub fn open(db_path: impl AsRef<Path>) -> Result<Self>
pub fn open(db_path: impl AsRef<Path>) -> Result<Self>
Open an existing index. Returns an error if the database doesn’t exist or can’t be migrated to the current schema.
Sourcepub fn build(
root: impl AsRef<Path>,
db_path: impl AsRef<Path>,
options: IndexOptions,
) -> Result<IndexReport>
pub fn build( root: impl AsRef<Path>, db_path: impl AsRef<Path>, options: IndexOptions, ) -> Result<IndexReport>
Build (or refresh) an index from a repository on disk. This is the
library equivalent of tessera index <root>.
pub fn db_path(&self) -> &Path
pub fn connection(&self) -> &Connection
pub fn find_definition(&self, symbol: &str) -> Result<DefinitionResult>
pub fn find_references(&self, symbol: &str) -> Result<ReferencesResult>
pub fn outline(&self, path: impl AsRef<Path>) -> Result<OutlineResult>
pub fn expand(&self, symbol: &str) -> Result<ExpandResult>
pub fn impact(&self, symbol: &str, depth: usize) -> Result<ImpactResult>
pub fn validate(&self, symbol: &str) -> Result<ValidateResult>
pub fn validate_snippet( &self, code: &str, language: Language, ) -> Result<ValidateSnippetResult>
pub fn stats(&self) -> Result<StatsResult>
pub fn tests_for(&self, symbol: &str) -> Result<TestsForResult>
pub fn search( &self, pattern: &str, options: SearchOptions, ) -> Result<SearchResult>
pub fn context_pack( &self, symbol: &str, budget_tokens: usize, ) -> Result<ContextPack>
pub fn diff_impact( &self, from_ref: &str, to_ref: Option<&str>, depth: usize, ) -> Result<DiffImpactResult>
pub fn imports(&self, path: &str) -> Result<ImportsResult>
pub fn imported_by(&self, source: &str) -> Result<ImportedByResult>
pub fn signature(&self, symbol: &str) -> Result<SignatureResult>
pub fn siblings(&self, symbol: &str) -> Result<SiblingsResult>
Auto Trait Implementations§
impl !Freeze for Index
impl !RefUnwindSafe for Index
impl Send for Index
impl !Sync for Index
impl Unpin for Index
impl UnsafeUnpin for Index
impl !UnwindSafe for Index
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