pub struct Value {
pub value: Bytes,
pub embedding: Option<Vec<f32>>,
pub importance: f32,
pub ttl_commits: Option<u64>,
pub meta: BTreeMap<String, String>,
}Expand description
The caller-supplied half of a write: everything except the logical clock.
Fields§
§value: BytesThe opaque stored value.
embedding: Option<Vec<f32>>Optional vector for crate::Db::search.
importance: f32Retention weight in [0, 1].
ttl_commits: Option<u64>Expiry measured in commits on the branch holding the entry.
meta: BTreeMap<String, String>Caller metadata.
Implementations§
Source§impl Value
impl Value
Sourcepub fn new(value: impl Into<Bytes>) -> Self
pub fn new(value: impl Into<Bytes>) -> Self
A value with default importance and no embedding, TTL or metadata.
Sourcepub fn with_embedding(self, embedding: Vec<f32>) -> Self
pub fn with_embedding(self, embedding: Vec<f32>) -> Self
Attach an embedding.
Sourcepub fn with_importance(self, importance: f32) -> Self
pub fn with_importance(self, importance: f32) -> Self
Set the retention weight.
Sourcepub fn with_ttl_commits(self, ttl: u64) -> Self
pub fn with_ttl_commits(self, ttl: u64) -> Self
Set the commit-counted TTL.
Trait Implementations§
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl !Freeze for Value
impl Forget for Value
impl Move for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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