pub struct VectorIndex {
pub id: String,
pub name: String,
pub index_type: IndexType,
pub dimensions: usize,
pub vector_count: usize,
pub metadata: HashMap<String, String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Vector index for similarity search
Fields§
§id: StringIndex ID
name: StringIndex name
index_type: IndexTypeIndex type
dimensions: usizeVector dimensions
vector_count: usizeNumber of vectors indexed
metadata: HashMap<String, String>Index metadata
created_at: DateTime<Utc>Creation timestamp
updated_at: DateTime<Utc>Last updated timestamp
Implementations§
Source§impl VectorIndex
impl VectorIndex
Sourcepub fn new(
id: String,
name: String,
index_type: IndexType,
dimensions: usize,
) -> Self
pub fn new( id: String, name: String, index_type: IndexType, dimensions: usize, ) -> Self
Create a new vector index
Sourcepub fn add_metadata(&mut self, key: String, value: String)
pub fn add_metadata(&mut self, key: String, value: String)
Add metadata to index
Sourcepub fn get_metadata(&self, key: &str) -> Option<&String>
pub fn get_metadata(&self, key: &str) -> Option<&String>
Get metadata value
Sourcepub fn remove_metadata(&mut self, key: &str) -> Option<String>
pub fn remove_metadata(&mut self, key: &str) -> Option<String>
Remove metadata
Sourcepub fn update_vector_count(&mut self, count: usize)
pub fn update_vector_count(&mut self, count: usize)
Update vector count
Sourcepub fn estimated_size_bytes(&self) -> u64
pub fn estimated_size_bytes(&self) -> u64
Get index size estimate in bytes
Sourcepub fn stats(&self) -> IndexStats
pub fn stats(&self) -> IndexStats
Get index statistics
Trait Implementations§
Source§impl Clone for VectorIndex
impl Clone for VectorIndex
Source§fn clone(&self) -> VectorIndex
fn clone(&self) -> VectorIndex
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 VectorIndex
impl Debug for VectorIndex
Source§impl<'de> Deserialize<'de> for VectorIndex
impl<'de> Deserialize<'de> for VectorIndex
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 VectorIndex
impl RefUnwindSafe for VectorIndex
impl Send for VectorIndex
impl Sync for VectorIndex
impl Unpin for VectorIndex
impl UnwindSafe for VectorIndex
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