pub trait VectorStore<K: U64 = u64, V: Serialize + DeserializeOwned + Clone = Properties>: Clone {
Show 13 methods
// Required methods
fn new(name: Option<&str>) -> Self;
fn len(&self) -> u64;
fn is_empty(&self) -> bool;
fn push(&mut self, id: K, value: V);
fn has(&self, key: K) -> bool;
fn get(&self, key: K) -> Option<&(K, V)>;
fn get_mut(&mut self, key: K) -> Option<&mut (K, V)>;
fn get_index(&self, index: u64) -> Option<&(K, V)>;
fn get_index_mut(&mut self, index: u64) -> Option<&mut (K, V)>;
fn sort(&mut self);
fn iter<'a>(&'a self) -> impl Iterator<Item = &'a (K, V)>
where K: 'a,
V: 'a;
fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut (K, V)>
where K: 'a,
V: 'a;
// Provided method
fn cleanup(&mut self) { ... }
}Expand description
Represents a Vector store
Required Methods§
Sourcefn get_index_mut(&mut self, index: u64) -> Option<&mut (K, V)>
fn get_index_mut(&mut self, index: u64) -> Option<&mut (K, V)>
get a mutable value from the store
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.