pub struct Document { /* private fields */ }
Implementations§
Source§impl Document
impl Document
pub fn new() -> Self
pub fn with_id(self, id: impl Into<String>) -> Self
pub fn with_vector(self, vector: Vec<f64>) -> Self
pub fn with_field(self, key: impl Into<String>, value: impl Into<Value>) -> Self
pub fn with_score(self, score: f64) -> Self
pub fn get(&self, key: &str) -> Option<&Value>
pub fn get_id(&self) -> Option<&str>
pub fn get_vector(&self) -> Option<Vec<f64>>
pub fn get_score(&self) -> Option<f64>
pub fn insert(&mut self, key: impl Into<String>, value: impl Into<Value>)
pub fn remove(&mut self, key: &str) -> Option<Value>
pub fn keys(&self) -> impl Iterator<Item = &String>
pub fn values(&self) -> impl Iterator<Item = &Value>
pub fn iter(&self) -> impl Iterator<Item = (&String, &Value)>
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Document
impl<'de> Deserialize<'de> for Document
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 Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
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