pub struct ModuleInfo {
pub path: String,
pub language: String,
pub docstring: Option<String>,
pub functions: Vec<FunctionInfo>,
pub classes: Vec<ClassInfo>,
pub imports: Vec<ImportInfo>,
pub call_graph: Option<CallGraphInfo>,
}Expand description
Information about a complete module/file.
Fields§
§path: StringFile path (serializes as “file_path” for Python compatibility)
language: StringDetected language
docstring: Option<String>Module-level docstring (e.g., Python module docstrings)
functions: Vec<FunctionInfo>Top-level functions
classes: Vec<ClassInfo>Classes/structs
imports: Vec<ImportInfo>Import statements
call_graph: Option<CallGraphInfo>Module-level call graph (function relationships within this module). None if not computed (call graph extraction is optional/expensive).
Implementations§
Source§impl ModuleInfo
impl ModuleInfo
Sourcepub fn to_dict(&self) -> Value
pub fn to_dict(&self) -> Value
Convert to dictionary format with computed signatures.
Returns a complete JSON representation suitable for serialization,
with all function and class signatures pre-computed. This format
matches the Python ModuleInfo.to_dict() output for compatibility.
Serialization helper for library consumers needing full module representation.
Sourcepub fn to_compact(&self) -> Value
pub fn to_compact(&self) -> Value
Convert to compact format optimized for LLM context.
Returns a condensed JSON representation that minimizes token usage while preserving essential information.
Serialization helper for library consumers needing compact representation.
Sourcepub fn to_compact_with_limits(
&self,
max_module_doc_len: usize,
max_class_doc_len: usize,
) -> Value
pub fn to_compact_with_limits( &self, max_module_doc_len: usize, max_class_doc_len: usize, ) -> Value
Convert to compact format with custom docstring length limits.
Serialization helper for library consumers needing compact representation.
Trait Implementations§
Source§impl Clone for ModuleInfo
impl Clone for ModuleInfo
Source§fn clone(&self) -> ModuleInfo
fn clone(&self) -> ModuleInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModuleInfo
impl Debug for ModuleInfo
Source§impl Default for ModuleInfo
impl Default for ModuleInfo
Source§impl<'de> Deserialize<'de> for ModuleInfo
impl<'de> Deserialize<'de> for ModuleInfo
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 ModuleInfo
impl RefUnwindSafe for ModuleInfo
impl Send for ModuleInfo
impl Sync for ModuleInfo
impl Unpin for ModuleInfo
impl UnwindSafe for ModuleInfo
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request