pub struct IngestDocument { /* private fields */ }Expand description
A validated, hash-stamped document ready for graph extraction.
Created exclusively through super::IngestSourceAdapter::parse implementations,
which ensure:
contentis non-empty.source_uriis non-empty.content_hashis the canonical BLAKE3 hex digest ofcontent.provenanceis fully populated with the origin matching the source kind (seeIngestSourceKind::graph_origin).
§Examples
use zeph_memory::graph::ingest::{IngestDocument, IngestSourceKind};
// Documents are created by adapters. Direct construction is crate-private.
// This example demonstrates what the adapter produces.
let uri = doc.source_uri();
let hash = doc.content_hash();
let content = doc.content();Implementations§
Source§impl IngestDocument
impl IngestDocument
Sourcepub fn context(&self) -> &[String]
pub fn context(&self) -> &[String]
Recent context messages that precede this document (used as extraction context).
Sourcepub fn provenance(&self) -> &GraphProvenance
pub fn provenance(&self) -> &GraphProvenance
Provenance metadata (origin, batch ID, source URI).
Sourcepub fn content_hash(&self) -> &str
pub fn content_hash(&self) -> &str
The canonical BLAKE3 hex digest of Self::content.
Computed once at construction time and cached.
Sourcepub fn source_uri(&self) -> &str
pub fn source_uri(&self) -> &str
Repository-relative source locator, e.g. "subagent:<task_id>#42".
Convenience accessor for provenance().source_uri — guaranteed non-None
for all documents created by adapters.
Trait Implementations§
Source§impl Clone for IngestDocument
impl Clone for IngestDocument
Source§fn clone(&self) -> IngestDocument
fn clone(&self) -> IngestDocument
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IngestDocument
impl RefUnwindSafe for IngestDocument
impl Send for IngestDocument
impl Sync for IngestDocument
impl Unpin for IngestDocument
impl UnsafeUnpin for IngestDocument
impl UnwindSafe for IngestDocument
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
Mutably borrows from an owned value. Read more
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,
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>
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 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>
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 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>
Wrap the input message
T in a tonic::Request