pub struct KnowledgeChunk {
pub chunk_id: String,
pub source_id: String,
pub source_version: Option<String>,
pub effective_from: Option<NaiveDate>,
pub effective_to: Option<NaiveDate>,
pub permissions: Vec<String>,
pub citation: Citation,
pub text: String,
pub trust: TrustLevel,
pub sensitivity: DataSensitivity,
}Expand description
One retrieved chunk with provenance (spec §19.2).
Fields§
§chunk_id: StringChunk identifier.
source_id: StringSource identifier.
source_version: Option<String>Source version.
effective_from: Option<NaiveDate>First day the content is effective.
effective_to: Option<NaiveDate>Last day the content is effective.
permissions: Vec<String>Permission tags required to read it.
citation: CitationCitation metadata.
text: StringThe text.
trust: TrustLevelTrust level.
sensitivity: DataSensitivitySensitivity.
Implementations§
Source§impl KnowledgeChunk
impl KnowledgeChunk
Sourcepub fn is_effective_on(&self, date: NaiveDate) -> bool
pub fn is_effective_on(&self, date: NaiveDate) -> bool
Returns true when the chunk is effective on date.
Trait Implementations§
Source§impl Clone for KnowledgeChunk
impl Clone for KnowledgeChunk
Source§impl Debug for KnowledgeChunk
impl Debug for KnowledgeChunk
Source§impl<'de> Deserialize<'de> for KnowledgeChunk
impl<'de> Deserialize<'de> for KnowledgeChunk
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
impl Eq for KnowledgeChunk
Source§impl PartialEq for KnowledgeChunk
impl PartialEq for KnowledgeChunk
Source§impl Serialize for KnowledgeChunk
impl Serialize for KnowledgeChunk
impl StructuralPartialEq for KnowledgeChunk
Auto Trait Implementations§
impl Freeze for KnowledgeChunk
impl RefUnwindSafe for KnowledgeChunk
impl Send for KnowledgeChunk
impl Sync for KnowledgeChunk
impl Unpin for KnowledgeChunk
impl UnsafeUnpin for KnowledgeChunk
impl UnwindSafe for KnowledgeChunk
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.