#[non_exhaustive]pub struct Fact {
pub text: String,
pub metadata: Value,
}Expand description
One stored fact in long-term memory.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.text: StringPlain-text body, embedded for retrieval.
metadata: ValueCaller-supplied metadata, opaque to the store.
Implementations§
Source§impl Fact
impl Fact
Sourcepub fn new(text: impl Into<String>) -> Self
pub fn new(text: impl Into<String>) -> Self
Prefer this over struct literals outside klieo-core (#[non_exhaustive]);
metadata defaults to JSON null — attach it with Fact::with_metadata.
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
Override the default JSON-null metadata with an opaque caller value.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Fact
impl<'de> Deserialize<'de> for Fact
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 Fact
impl RefUnwindSafe for Fact
impl Send for Fact
impl Sync for Fact
impl Unpin for Fact
impl UnsafeUnpin for Fact
impl UnwindSafe for Fact
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