pub struct Entity {
pub id: EntityId,
pub title: String,
pub entity_type: String,
pub mem: String,
pub file_path: String,
pub metadata: IndexMap<String, MetadataValue>,
pub sections: IndexMap<String, String>,
pub relationships: Vec<Relationship>,
pub content_hash: String,
pub stub: bool,
pub stub_kind: Option<StubKind>,
pub heading_spans: HashMap<String, Vec<HeadingSpan>>,
}Expand description
A parsed entity with metadata, sections, and relationships.
Fields§
§id: EntityId§title: String§entity_type: String§mem: String§file_path: String§metadata: IndexMap<String, MetadataValue>Frontmatter metadata. Ordered (IndexMap) so iteration preserves the
YAML key order the parser saw — required for deterministic rendering
by render::render_entity_markdown, which iterates this map directly.
sections: IndexMap<String, String>Section keys map to raw content. Ordered (IndexMap) so iteration yields sections in the order the parser inserted them — today that matches the schema’s declared order, which is what renderers rely on for deterministic output.
relationships: Vec<Relationship>§content_hash: StringSHA-256 hash of the raw markdown content for optimistic locking.
stub: boolTrue if this is a stub entity (created from an unresolved reference).
Tracks stub_kind.is_some() and is preserved for compatibility with
readers that don’t need the typed provenance. New code branches on
Self::stub_kind when the origin matters (ForwardReference /
LoadTime / Residual).
stub_kind: Option<StubKind>Typed stub provenance — set at stub creation and persists for the
engine instance’s lifetime. None for real (non-stub) entities;
Some(kind) matches stub == true by construction (every
make_stub site sets both fields atomically). See StubKind
for the variant semantics and lifecycle rules.
heading_spans: HashMap<String, Vec<HeadingSpan>>Per-H2-section H3–H6 heading spans — a derived parse artefact used by
search to attach heading_path to per-term matches. Keyed by H2
section key; value lists spans in document order with byte offsets
into the raw section content. Regenerated on every parse; never
written back to markdown, never hashed, never round-tripped. The
in-memory graph stays flat — sub-sections are search-only metadata.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Entity
impl<'de> Deserialize<'de> for Entity
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Entity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Entity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Entity
impl Serialize for Entity
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for Entity
impl RefUnwindSafe for Entity
impl Send for Entity
impl Sync for Entity
impl Unpin for Entity
impl UnsafeUnpin for Entity
impl UnwindSafe for Entity
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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 more