pub struct VectorDocument {
pub id: u64,
pub embedding: Option<Vec<f32>>,
pub text: Option<String>,
pub metadata: Value,
}Expand description
A document stored in a vector collection.
Fields§
§id: u64Numeric ID assigned by KeraDB.
embedding: Option<Vec<f32>>The stored embedding (may be absent if not requested).
text: Option<String>Original text if stored via lazy embedding.
metadata: ValueUser-supplied metadata as arbitrary JSON.
Implementations§
Source§impl VectorDocument
impl VectorDocument
Sourcepub fn from_value(v: &Value) -> Option<Self>
pub fn from_value(v: &Value) -> Option<Self>
Deserialise from the JSON object returned by the native library.
Trait Implementations§
Source§impl Clone for VectorDocument
impl Clone for VectorDocument
Source§fn clone(&self) -> VectorDocument
fn clone(&self) -> VectorDocument
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 VectorDocument
impl Debug for VectorDocument
Auto Trait Implementations§
impl Freeze for VectorDocument
impl RefUnwindSafe for VectorDocument
impl Send for VectorDocument
impl Sync for VectorDocument
impl Unpin for VectorDocument
impl UnsafeUnpin for VectorDocument
impl UnwindSafe for VectorDocument
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