Skip to main content

Index

Struct Index 

Source
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

Source

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.

Source

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>.

Source

pub fn db_path(&self) -> &Path

Source

pub fn connection(&self) -> &Connection

Source

pub fn find_definition(&self, symbol: &str) -> Result<DefinitionResult>

Source

pub fn find_references(&self, symbol: &str) -> Result<ReferencesResult>

Source

pub fn outline(&self, path: impl AsRef<Path>) -> Result<OutlineResult>

Source

pub fn expand(&self, symbol: &str) -> Result<ExpandResult>

Source

pub fn impact(&self, symbol: &str, depth: usize) -> Result<ImpactResult>

Source

pub fn validate(&self, symbol: &str) -> Result<ValidateResult>

Source

pub fn validate_snippet( &self, code: &str, language: Language, ) -> Result<ValidateSnippetResult>

Source

pub fn stats(&self) -> Result<StatsResult>

Source

pub fn tests_for(&self, symbol: &str) -> Result<TestsForResult>

Source

pub fn search( &self, pattern: &str, options: SearchOptions, ) -> Result<SearchResult>

Source

pub fn context_pack( &self, symbol: &str, budget_tokens: usize, ) -> Result<ContextPack>

Source

pub fn diff_impact( &self, from_ref: &str, to_ref: Option<&str>, depth: usize, ) -> Result<DiffImpactResult>

Source

pub fn imports(&self, path: &str) -> Result<ImportsResult>

Source

pub fn imported_by(&self, source: &str) -> Result<ImportedByResult>

Source

pub fn signature(&self, symbol: &str) -> Result<SignatureResult>

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.