Skip to main content

ParsedEntity

Struct ParsedEntity 

Source
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: Uuid

Unique identifier — bridges Qdrant and Neo4j records.

§name: String

Human-readable name (class name, method name, function name).

§kind: EntityKind

The kind of code construct this entity represents.

§fqn: String

Fully qualified name for disambiguation.

  • For Java: com.example.connector.AlternativeConnectorService.proxyManager
  • For TypeScript: ClassName.methodName or just functionName for 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: String

Source language ("java" or "typescript").

§file_path: String

Absolute path of the source file containing this entity.

§start_line: usize

1-based line number where the entity declaration starts.

§end_line: usize

1-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: String

Logical 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: bool

true 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: String

The text that will be fed to the embedding model. Constructed in Stage 3 (prepare) from name, signature, and docstring.

Implementations§

Source§

impl ParsedEntity

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParsedEntity

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ParsedEntity

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<&ParsedEntity> for ResolutionEntity

Source§

fn from(entity: &ParsedEntity) -> Self

Converts to this type from the input type.
Source§

impl Serialize for ParsedEntity

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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