pub struct DocumentMeta {
pub id: String,
pub name: String,
pub format: String,
pub source_path: Option<PathBuf>,
pub description: Option<String>,
pub page_count: Option<usize>,
pub line_count: Option<usize>,
pub created_at: DateTime<Utc>,
pub modified_at: DateTime<Utc>,
}Expand description
Metadata for a persisted document.
Fields§
§id: StringUnique document identifier.
name: StringDocument name/title.
format: StringDocument format (md, pdf, etc.).
source_path: Option<PathBuf>Source file path.
description: Option<String>Document description.
page_count: Option<usize>Page count (for PDFs).
line_count: Option<usize>Line count (for text files).
created_at: DateTime<Utc>Creation timestamp.
modified_at: DateTime<Utc>Last modified timestamp.
Implementations§
Source§impl DocumentMeta
impl DocumentMeta
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
format: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, name: impl Into<String>, format: impl Into<String>, ) -> Self
Create new document metadata.
Sourcepub fn with_source_path(self, path: impl Into<PathBuf>) -> Self
pub fn with_source_path(self, path: impl Into<PathBuf>) -> Self
Set the source path.
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Set the description.
Trait Implementations§
Source§impl Clone for DocumentMeta
impl Clone for DocumentMeta
Source§fn clone(&self) -> DocumentMeta
fn clone(&self) -> DocumentMeta
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DocumentMeta
impl Debug for DocumentMeta
Source§impl<'de> Deserialize<'de> for DocumentMeta
impl<'de> Deserialize<'de> for DocumentMeta
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
Auto Trait Implementations§
impl Freeze for DocumentMeta
impl RefUnwindSafe for DocumentMeta
impl Send for DocumentMeta
impl Sync for DocumentMeta
impl Unpin for DocumentMeta
impl UnsafeUnpin for DocumentMeta
impl UnwindSafe for DocumentMeta
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