pub struct ParsedEntity {Show 29 fields
pub uuid: Uuid,
pub name: String,
pub kind: EntityKind,
pub fqn: String,
pub signature: Option<String>,
pub docstring: Option<String>,
pub inline_comments: Vec<String>,
pub decorators: Vec<String>,
pub rust_attributes: Option<Vec<String>>,
pub impl_trait: Option<String>,
pub impl_target: Option<String>,
pub generics: Option<String>,
pub lifetimes: Option<Vec<String>>,
pub alias_module_path: Option<String>,
pub original_export_name: Option<String>,
pub default_export: Option<String>,
pub language: String,
pub file_path: String,
pub start_line: usize,
pub end_line: usize,
pub enclosing_class: Option<String>,
pub enclosing_class_fqn: Option<String>,
pub repo_name: String,
pub is_test_context: bool,
pub import_scope: Option<Arc<ImportScope>>,
pub reference_intents: Vec<ReferenceIntent>,
pub calls: Vec<Uuid>,
pub relationships: Vec<(Uuid, RelationshipType)>,
pub embed_text: String,
}Expand description
A raw entity extracted from the AST before embedding.
Created in Stage 2 (parse) and enriched with a UUID in Stage 3 (prepare).
Fields§
§uuid: UuidUnique identifier — bridges Qdrant and Neo4j records.
name: StringHuman-readable name (class name, method name, function name).
kind: EntityKindThe kind of code construct this entity represents.
fqn: StringFully qualified name for disambiguation.
- For Java:
com.example.connector.AlternativeConnectorService.proxyManager - For TypeScript:
ClassName.methodNameor justfunctionNamefor top-level functions - For classes/interfaces:
com.example.connector.AlternativeConnectorService
signature: Option<String>Full signature string for methods/functions (e.g. public void foo(int x)).
None for class/interface entities.
docstring: Option<String>Associated documentation: Javadoc, JSDoc, or preceding comments found immediately before this node in the source file. This captures comment blocks that directly precede declarations.
inline_comments: Vec<String>Inline comments found within this entity’s body. For classes: comments inside the class body but outside any methods. For methods/functions: comments inside the method/function body. These provide implementation context and are associated with the containing entity.
decorators: Vec<String>Decorators and annotations applied to this entity.
Examples: @Override, @OnEvent('foo'), @GetMapping("/path"), etc.
Populated during the parse stage for methods, functions, classes, and constants.
rust_attributes: Option<Vec<String>>For Rust: list of attributes/decorators e.g., vec![“derive(Clone)”, “tokio::main”]
impl_trait: Option<String>For Rust impl blocks: the trait being implemented (if any)
e.g., Some(“Debug”) for impl Debug for MyStruct
impl_target: Option<String>For Rust impl blocks: the target type being implemented for
e.g., “MyStruct” for impl MyStruct { ... }
generics: Option<String>For Rust generic types: the full generic signature e.g., “<T: Clone, U: Default>” or “<’a, T>”
lifetimes: Option<Vec<String>>For Rust: lifetime parameters e.g., vec![“’a”, “’b”]
alias_module_path: Option<String>For JS/TS import aliases: if this entity is a require() or import alias,
the relative module path (e.g., “./ResolveCache”, “../util/fs”).
Used during resolution to follow cross-file aliases to the original definition.
original_export_name: Option<String>For TS named imports: the original export name in the target module.
E.g., import { MyTsTarget as MyTsAlias } → Some(“MyTsTarget”).
Used by the alias resolver to look up the correct entity in the target file.
default_export: Option<String>For JS/TS module-level entities (<module>): the name exported as default
(e.g., module.exports = ResolveCache). Used by the alias resolver
to resolve bare module imports to the correct entity within the target file.
language: StringSource language ("java" or "typescript").
file_path: StringAbsolute path of the source file containing this entity.
start_line: usize1-based line number where the entity declaration starts.
end_line: usize1-based line number where the entity declaration ends. Used to determine if an orphaned reference is contained within this entity.
enclosing_class: Option<String>Enclosing class name for methods. Used to resolve local calls.
None for class/interface entities and top-level functions.
enclosing_class_fqn: Option<String>Fully qualified name of the enclosing class for CONTAINS disambiguation.
When set, the Neo4j CONTAINS auto-link uses this FQN to match the exact
parent entity instead of matching by bare name, which can collide
when multiple entities share the same class name (e.g. fixtures vs real).
Populated by language-specific qualifier passes; None for non-Rust or
when the enclosing class FQN is unknown.
repo_name: StringLogical repository name for multi-repository isolation. Used to separate entities from different codebases in shared databases. Example: “my-java-repo”, “my-typescript-repo”, “my-microservice”
is_test_context: booltrue when this entity lives under a Rust #[cfg(test)] module
(or any nesting depth of such modules). Surfaced as a Neo4j property
so MCP consumers can distinguish callers/callees that come from
test code (living documentation) versus production code.
Always false for non-Rust languages.
import_scope: Option<Arc<ImportScope>>Package and imports of the entity’s file (Java, Kotlin), shared by every entity of that file. Only call/type resolution reads it, so it is neither persisted nor serialized.
reference_intents: Vec<ReferenceIntent>Raw reference intents extracted from this entity. Populated during the parse stage; may be empty if no references were found. These are resolved to UUIDs during the ingest stage and converted to graph relationships.
calls: Vec<Uuid>UUIDs of entities this entity directly calls / depends on.
DEPRECATED: Use relationships instead for typed edges.
Populated during the ingest stage based on reference_intents resolution.
Kept for backward compatibility.
relationships: Vec<(Uuid, RelationshipType)>Typed relationships to other entities. Each edge includes the target UUID and the relationship type (CALLS, EXTENDS, IMPLEMENTS, REFERENCES). Populated during the ingest stage based on reference_intents resolution.
embed_text: StringThe text that will be fed to the embedding model.
Constructed in Stage 3 (prepare) from name, signature, and docstring.
Implementations§
Source§impl ParsedEntity
impl ParsedEntity
Sourcepub fn new(
name: impl Into<String>,
kind: EntityKind,
fqn: impl Into<String>,
signature: Option<String>,
docstring: Option<String>,
language: impl Into<String>,
file_path: impl Into<String>,
start_line: usize,
end_line: usize,
enclosing_class: Option<String>,
repo_name: impl Into<String>,
) -> Self
pub fn new( name: impl Into<String>, kind: EntityKind, fqn: impl Into<String>, signature: Option<String>, docstring: Option<String>, language: impl Into<String>, file_path: impl Into<String>, start_line: usize, end_line: usize, enclosing_class: Option<String>, repo_name: impl Into<String>, ) -> Self
Create a new entity with a deterministic UUID v5.
The base UUID is derived from the entity’s unique identity ({repo_name}:{file_path}:{fqn}:{start_line})
to ensure the same entity receives the same UUID across indexing runs.
If multiple entities within a single file share the same base UUID identity,
a collision-only disambiguation pass (disambiguate_entity_uuids) is run to assign
deterministic UUIDs to colliding members. Non-first members sharing a base identity receive:
Uuid::new_v5(&NAMESPACE_KNOT, "{base identity}:{kind label}:{name}#{n}"), where n is its
1-based rank among the members sharing that same (kind, name).
Trait Implementations§
Source§impl Clone for ParsedEntity
impl Clone for ParsedEntity
Source§impl Debug for ParsedEntity
impl Debug for ParsedEntity
Source§impl<'de> Deserialize<'de> for ParsedEntity
impl<'de> Deserialize<'de> for ParsedEntity
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>,
Source§impl From<&ParsedEntity> for ResolutionEntity
impl From<&ParsedEntity> for ResolutionEntity
Source§fn from(entity: &ParsedEntity) -> Self
fn from(entity: &ParsedEntity) -> Self
Auto Trait Implementations§
impl Forget for ParsedEntity
impl Freeze for ParsedEntity
impl Move for ParsedEntity
impl RefUnwindSafe for ParsedEntity
impl Send for ParsedEntity
impl Sync for ParsedEntity
impl Unpin for ParsedEntity
impl UnsafeUnpin for ParsedEntity
impl UnwindSafe for ParsedEntity
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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