pub struct CodeIndex {
pub symbols: Vec<Symbol>,
pub calls: Vec<CallEdge>,
pub imports: Vec<ImportEdge>,
pub files: Vec<PathBuf>,
pub root: PathBuf,
/* private fields */
}Fields§
§symbols: Vec<Symbol>§calls: Vec<CallEdge>§imports: Vec<ImportEdge>§files: Vec<PathBuf>§root: PathBufImplementations§
Source§impl CodeIndex
impl CodeIndex
pub fn build( parsed: Vec<ParsedFile>, root: &Path, embedder: Option<&dyn Embedder>, ) -> Self
pub fn save(&self, path: &Path) -> Result<()>
pub fn load(path: &Path) -> Result<Self>
pub fn find_symbols_by_name(&self, name: &str) -> Vec<&Symbol>
pub fn find_symbols_by_pattern(&self, pattern: &str) -> Vec<&Symbol>
pub fn find_calls_to(&self, name: &str) -> Vec<&CallEdge>
pub fn find_calls_by(&self, name: &str) -> Vec<&CallEdge>
pub fn find_implementations(&self, name: &str) -> Vec<&Symbol>
pub fn find_symbols_in_file(&self, file: &Path) -> Vec<&Symbol>
pub fn relative_path(&self, path: &Path) -> String
pub fn find_imports_in_file(&self, file: &Path) -> Vec<&ImportEdge>
pub fn find_importers_of(&self, name: &str) -> Vec<&ImportEdge>
pub fn semantic_search( &self, query_embed: &[f32], k: usize, ) -> Vec<(f64, &Symbol)>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CodeIndex
impl<'de> Deserialize<'de> for CodeIndex
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CodeIndex
impl RefUnwindSafe for CodeIndex
impl Send for CodeIndex
impl Sync for CodeIndex
impl Unpin for CodeIndex
impl UnsafeUnpin for CodeIndex
impl UnwindSafe for CodeIndex
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