Struct flechasdb::db::stored::QueryResult
source · pub struct QueryResult<'a, T, FS> {
pub partition_index: usize,
pub vector_id: Uuid,
pub vector_index: usize,
pub squared_distance: T,
/* private fields */
}Expand description
Query result.
Fields§
§partition_index: usizePartition index.
vector_id: UuidVector ID. Must be unique across the entire database.
vector_index: usizeVector index. Local index in the partition.
squared_distance: TApproximate squared distance.
Implementations§
source§impl<'a, T, FS> QueryResult<'a, T, FS>where
T: Scalar,
FS: FileSystem,
Database<T, FS>: LoadPartition<T> + LoadCodebook<T> + LoadPartitionCentroids<T>,
impl<'a, T, FS> QueryResult<'a, T, FS>where T: Scalar, FS: FileSystem, Database<T, FS>: LoadPartition<T> + LoadCodebook<T> + LoadPartitionCentroids<T>,
sourcepub fn get_attribute<K>(
&self,
key: &K
) -> Result<Option<AttributeValueRef<'_>>, Error>where
String: Borrow<K>,
K: Hash + Eq + ?Sized,
pub fn get_attribute<K>( &self, key: &K ) -> Result<Option<AttributeValueRef<'_>>, Error>where String: Borrow<K>, K: Hash + Eq + ?Sized,
Returns an attribute value of the vector corresponding to the result.
The first call of this function on a result belonging to a partition will take longer because it will load the attributes of the partition.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T, FS> !RefUnwindSafe for QueryResult<'a, T, FS>
impl<'a, T, FS> !Send for QueryResult<'a, T, FS>
impl<'a, T, FS> !Sync for QueryResult<'a, T, FS>
impl<'a, T, FS> Unpin for QueryResult<'a, T, FS>where T: Unpin,
impl<'a, T, FS> !UnwindSafe for QueryResult<'a, T, FS>
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