pub struct Document {Show 13 fields
pub id: String,
pub source: String,
pub source_id: String,
pub source_url: Option<String>,
pub title: Option<String>,
pub author: Option<String>,
pub created_at: i64,
pub updated_at: i64,
pub content_type: String,
pub body: String,
pub metadata_json: String,
pub raw_json: Option<String>,
pub dedup_hash: String,
}Expand description
Normalized document stored in the documents table.
Created during ingestion by normalizing a SourceItem. Each document
is uniquely identified by the (source, source_id) pair, and carries
a dedup_hash (SHA-256 of source + source_id + updated_at + body) to
detect content changes.
Timestamps are stored as Unix epoch seconds (i64) for efficient comparison and indexing.
Fields§
§id: StringUUID v4 primary key.
source: StringConnector name that produced this document.
source_id: StringUnique identifier within the source.
source_url: Option<String>Web-browsable URL, if available.
title: Option<String>Human-readable title.
Author from source metadata.
created_at: i64Creation timestamp (Unix epoch seconds).
updated_at: i64Last modification timestamp (Unix epoch seconds).
content_type: StringMIME content type.
body: StringFull text body.
metadata_json: StringConnector-specific metadata as JSON.
raw_json: Option<String>Raw connector response.
dedup_hash: StringSHA-256 hash for deduplication: H(source || source_id || updated_at || body).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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