pub struct Document {
pub base: DataPoint,
pub document_type: String,
pub name: String,
pub raw_data_location: String,
pub mime_type: String,
pub extension: String,
pub data_id: Uuid,
pub external_metadata: Option<String>,
}Expand description
A classified document derived from a Data item.
Mirrors the Python Document class hierarchy. In Python, each document type
is a separate class (TextDocument, PdfDocument, etc.). In Rust we use a single
struct with a document_type field and the base.data_type discriminator
set to the class name (e.g. “TextDocument”, “PdfDocument”).
Fields§
§base: DataPointDataPoint base — carries id, timestamps, metadata, data_type discriminator.
document_type: StringDocument type category: “text”, “pdf”, “csv”, “html”, “image”, “audio”, “unstructured”, “dlt_row”.
name: String§raw_data_location: String§mime_type: String§extension: String§data_id: UuidReference back to the source Data record.
external_metadata: Option<String>Pretty-printed external metadata JSON, if any.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Document
impl<'de> Deserialize<'de> for Document
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 HasDataPoint for Document
impl HasDataPoint for Document
Source§fn data_point(&self) -> &DataPoint
fn data_point(&self) -> &DataPoint
Borrow the embedded
DataPoint of this container.Source§fn data_point_mut(&mut self) -> &mut DataPoint
fn data_point_mut(&mut self) -> &mut DataPoint
Mutably borrow the embedded
DataPoint of this container.Source§fn for_each_child_mut(&mut self, _visit: &mut dyn FnMut(&mut dyn HasDataPoint))
fn for_each_child_mut(&mut self, _visit: &mut dyn FnMut(&mut dyn HasDataPoint))
Visit every owned child that itself implements
HasDataPoint.
Default: no children. Override on container types whose fields
own (rather than reference by Uuid) another HasDataPoint.Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more