Document

Struct Document 

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

UUID v4 primary key.

§source: String

Connector name that produced this document.

§source_id: String

Unique identifier within the source.

§source_url: Option<String>

Web-browsable URL, if available.

§title: Option<String>

Human-readable title.

§author: Option<String>

Author from source metadata.

§created_at: i64

Creation timestamp (Unix epoch seconds).

§updated_at: i64

Last modification timestamp (Unix epoch seconds).

§content_type: String

MIME content type.

§body: String

Full text body.

§metadata_json: String

Connector-specific metadata as JSON.

§raw_json: Option<String>

Raw connector response.

§dedup_hash: String

SHA-256 hash for deduplication: H(source || source_id || updated_at || body).

Trait Implementations§

Source§

impl Clone for Document

Source§

fn clone(&self) -> Document

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Document

Source§

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

Formats the value using the given formatter. 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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.