pub struct KnowledgeEntry {
pub id: String,
pub domain: KnowledgeDomain,
pub title: String,
pub content: String,
pub tags: Vec<String>,
pub source: Option<String>,
pub confidence: f64,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Knowledge entry
Fields§
§id: StringUnique identifier
domain: KnowledgeDomainDomain category
title: StringEntry title/key
content: StringKnowledge content
Tags for searching
source: Option<String>Source/reference
confidence: f64Confidence score (0.0-1.0)
created_at: DateTime<Utc>Creation timestamp
updated_at: DateTime<Utc>Last updated timestamp
Implementations§
Source§impl KnowledgeEntry
impl KnowledgeEntry
Sourcepub fn new(
domain: KnowledgeDomain,
title: impl Into<String>,
content: impl Into<String>,
) -> Self
pub fn new( domain: KnowledgeDomain, title: impl Into<String>, content: impl Into<String>, ) -> Self
Create a new knowledge entry
Sourcepub fn with_id(
id: impl Into<String>,
domain: KnowledgeDomain,
title: impl Into<String>,
content: impl Into<String>,
) -> Self
pub fn with_id( id: impl Into<String>, domain: KnowledgeDomain, title: impl Into<String>, content: impl Into<String>, ) -> Self
Create with explicit ID
Add tags
Sourcepub fn with_source(self, source: impl Into<String>) -> Self
pub fn with_source(self, source: impl Into<String>) -> Self
Add source
Sourcepub fn with_confidence(self, confidence: f64) -> Self
pub fn with_confidence(self, confidence: f64) -> Self
Set confidence
Sourcepub fn update_content(&mut self, content: impl Into<String>)
pub fn update_content(&mut self, content: impl Into<String>)
Update content
Trait Implementations§
Source§impl Clone for KnowledgeEntry
impl Clone for KnowledgeEntry
Source§fn clone(&self) -> KnowledgeEntry
fn clone(&self) -> KnowledgeEntry
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 KnowledgeEntry
impl Debug for KnowledgeEntry
Source§impl<'de> Deserialize<'de> for KnowledgeEntry
impl<'de> Deserialize<'de> for KnowledgeEntry
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 KnowledgeEntry
impl RefUnwindSafe for KnowledgeEntry
impl Send for KnowledgeEntry
impl Sync for KnowledgeEntry
impl Unpin for KnowledgeEntry
impl UnwindSafe for KnowledgeEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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