Struct kalosm_language::context::Document
source · pub struct Document { /* private fields */ }
Expand description
A document is a piece of text with a title.
Implementations§
source§impl Document
impl Document
sourcepub async fn new<T: IntoDocument>(source: T) -> Result<Self>
pub async fn new<T: IntoDocument>(source: T) -> Result<Self>
Create a new document from a source.
sourcepub fn from_parts(title: impl Into<String>, body: impl Into<String>) -> Self
pub fn from_parts(title: impl Into<String>, body: impl Into<String>) -> Self
Create a new document from the raw parts.
sourcepub fn set_summary(&mut self, summary: impl Into<String>)
pub fn set_summary(&mut self, summary: impl Into<String>)
Set the summary of the document.
sourcepub fn set_created_at(&mut self, created_at: DateTime<Utc>)
pub fn set_created_at(&mut self, created_at: DateTime<Utc>)
Set the created at time of the document.
sourcepub fn set_updated_at(&mut self, updated_at: DateTime<Utc>)
pub fn set_updated_at(&mut self, updated_at: DateTime<Utc>)
Set the updated at time of the document.
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 IntoDocument for Document
impl IntoDocument for Document
source§impl PartialEq for Document
impl PartialEq for Document
impl StructuralPartialEq for Document
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more