pub struct KnowledgeGraph {
pub files: HashMap<PathBuf, FileNode>,
pub relationships: Vec<Relationship>,
pub metadata: GraphMetadata,
pub module_parent: HashMap<PathBuf, PathBuf>,
pub module_children: HashMap<PathBuf, Vec<PathBuf>>,
pub module_segments: HashMap<PathBuf, Vec<String>>,
pub import_segments: HashMap<PathBuf, Vec<(Vec<Arc<str>>, Option<Arc<str>>)>>,
pub string_pool: Arc<Mutex<HashMap<String, Arc<str>>>>,
}Fields§
§files: HashMap<PathBuf, FileNode>§relationships: Vec<Relationship>§metadata: GraphMetadata§module_parent: HashMap<PathBuf, PathBuf>§module_children: HashMap<PathBuf, Vec<PathBuf>>§module_segments: HashMap<PathBuf, Vec<String>>§import_segments: HashMap<PathBuf, Vec<(Vec<Arc<str>>, Option<Arc<str>>)>>§string_pool: Arc<Mutex<HashMap<String, Arc<str>>>>Implementations§
Source§impl KnowledgeGraph
impl KnowledgeGraph
Sourcepub fn build_from_directory_with_cache_opts(
path: &Path,
mode: CacheMode,
no_ignore: bool,
) -> Result<Self, KnowledgeGraphError>
pub fn build_from_directory_with_cache_opts( path: &Path, mode: CacheMode, no_ignore: bool, ) -> Result<Self, KnowledgeGraphError>
Build a knowledge graph from a directory with explicit cache mode and ignore behavior.
Arguments:
path: Root directory to scan for Rust source files.mode: Cache usage policy (seeutils::cache::CacheMode).no_ignore: When true, bypasses.gitignore/.ignorerules in file discovery.
Returns a fully built KnowledgeGraph, loading from and/or updating the on-disk cache
according to mode. File discovery is performed via utils::file_walker::rust_files_with_options.
§Errors
Returns KnowledgeGraphError if file discovery, I/O, cache read/write, or parsing fails during build.
pub fn get_module_parent(&self, file: &PathBuf) -> Option<&PathBuf>
pub fn get_module_children(&self, file: &PathBuf) -> &[PathBuf]
Sourcepub fn build_from_directory_with_cache(
path: &Path,
mode: CacheMode,
) -> Result<Self, KnowledgeGraphError>
pub fn build_from_directory_with_cache( path: &Path, mode: CacheMode, ) -> Result<Self, KnowledgeGraphError>
Backward-compatible builder: reads env var KNOWLEDGE_RS_NO_IGNORE for ignore bypass.
§Errors
Returns KnowledgeGraphError when directory walking, file I/O, or parsing fails during build.
Sourcepub fn build_from_directory(path: &Path) -> Result<Self, KnowledgeGraphError>
pub fn build_from_directory(path: &Path) -> Result<Self, KnowledgeGraphError>
Backward-compatible builder: CacheMode::Use and env-derived ignore bypass.
§Errors
Returns KnowledgeGraphError on I/O or parsing failures during build.
Sourcepub fn build_from_directory_opts(
path: &Path,
no_ignore: bool,
) -> Result<Self, KnowledgeGraphError>
pub fn build_from_directory_opts( path: &Path, no_ignore: bool, ) -> Result<Self, KnowledgeGraphError>
Convenience builder: explicit ignore bypass with default CacheMode::Use.
§Errors
Returns KnowledgeGraphError on I/O or parsing failures during build.
Trait Implementations§
Source§impl Clone for KnowledgeGraph
impl Clone for KnowledgeGraph
Source§fn clone(&self) -> KnowledgeGraph
fn clone(&self) -> KnowledgeGraph
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KnowledgeGraph
impl Debug for KnowledgeGraph
Source§impl Default for KnowledgeGraph
impl Default for KnowledgeGraph
Source§fn default() -> KnowledgeGraph
fn default() -> KnowledgeGraph
Source§impl<'de> Deserialize<'de> for KnowledgeGraph
impl<'de> Deserialize<'de> for KnowledgeGraph
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>,
Auto Trait Implementations§
impl Freeze for KnowledgeGraph
impl RefUnwindSafe for KnowledgeGraph
impl Send for KnowledgeGraph
impl Sync for KnowledgeGraph
impl Unpin for KnowledgeGraph
impl UnwindSafe for KnowledgeGraph
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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