Skip to main content

Store

Struct Store 

Source
pub struct Store { /* private fields */ }

Implementations§

Source§

impl Store

Source

pub fn open(db_path: &Path, root: &Path) -> Result<Store>

Source

pub fn hash_of(source: &str) -> String

Stable content hash for freshness comparison. Uses DefaultHasher — deterministic within a build, sufficient for this use.

Source

pub fn is_current(&self, path: &str, source: &str) -> bool

Returns true if the stored hash for path matches hash_of(source).

Source

pub fn index_file(&self, path: &str, source: &str, mtime: i64) -> Result<()>

Transactionally re-index a file: delete prior rows, extract+resolve, insert new rows. No-ops for files with unsupported languages (upserts only the file row with lang=‘’).

Source

pub fn neighborhood(&self, symbol_name: &str) -> Option<Neighborhood>

Returns the definition + callers + callees + imports for the first symbol matching symbol_name.

When the same name is defined in more than one place this collapses to one arbitrary match; prefer Store::neighborhood_all in that case.

Source

pub fn neighborhood_all(&self, symbol_name: &str) -> Vec<Neighborhood>

Returns one Neighborhood per definition site matching symbol_name, ordered by file then start line (deterministic). Empty when the name is not indexed. This is the multi-result form that avoids the single-winner collapse of Store::neighborhood.

Source

pub fn symbol_names(&self) -> Vec<String>

Returns the names of every symbol currently in the index.

Source

pub fn resolve_in_file(&self, file: &str, name: &str) -> Option<SymbolRef>

Returns the first symbol named name in file.

Source

pub fn stats(&self) -> (usize, usize, usize)

Returns (files, symbols, edges) counts for rinne graph stats.

Source

pub fn symbols_in(&self, path: &str) -> Vec<Symbol>

Returns all symbols defined in a given file.

Auto Trait Implementations§

§

impl !Freeze for Store

§

impl !RefUnwindSafe for Store

§

impl !Sync for Store

§

impl !UnwindSafe for Store

§

impl Forget for Store

§

impl Move for Store

§

impl Send for Store

§

impl Unpin for Store

§

impl UnsafeUnpin for Store

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more