#[repr(u32)]pub enum MetricType {
Undefined = 0,
L2 = 1,
Ip = 2,
Cosine = 3,
MipsL2 = 4,
}Expand description
Distance metric type for vector similarity search.
Variants§
Undefined = 0
Undefined or unknown metric type.
L2 = 1
Euclidean distance (L2 norm). Smaller values indicate higher similarity.
Ip = 2
Inner product. Larger values indicate higher similarity.
Cosine = 3
Cosine similarity. Values range from -1 to 1; closer to 1 means more similar.
MipsL2 = 4
Maximum Inner Product Search with L2 normalization.
Trait Implementations§
Source§impl Clone for MetricType
impl Clone for MetricType
Source§fn clone(&self) -> MetricType
fn clone(&self) -> MetricType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MetricType
Source§impl Debug for MetricType
impl Debug for MetricType
Source§impl Display for MetricType
impl Display for MetricType
impl Eq for MetricType
Source§impl From<MetricType> for u32
impl From<MetricType> for u32
Source§fn from(mt: MetricType) -> Self
fn from(mt: MetricType) -> Self
Converts to this type from the input type.
Source§impl From<u32> for MetricType
impl From<u32> for MetricType
Source§impl PartialEq for MetricType
impl PartialEq for MetricType
Source§fn eq(&self, other: &MetricType) -> bool
fn eq(&self, other: &MetricType) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MetricType
Auto Trait Implementations§
impl Freeze for MetricType
impl RefUnwindSafe for MetricType
impl Send for MetricType
impl Sync for MetricType
impl Unpin for MetricType
impl UnsafeUnpin for MetricType
impl UnwindSafe for MetricType
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