#[repr(u32)]pub enum MetricType {
Undefined = 0,
L2 = 1,
Ip = 2,
Cosine = 3,
MipsL2 = 4,
}Expand description
Similarity metric. Search scores are always ordered from high to low; L2 is represented as negative squared distance at the API boundary.
Variants§
Implementations§
Source§impl MetricType
impl MetricType
pub fn higher_is_better(self) -> bool
Trait Implementations§
Source§impl Clone for MetricType
impl Clone for MetricType
impl Copy for MetricType
Source§impl Debug for MetricType
impl Debug for MetricType
Source§impl<'de> Deserialize<'de> for MetricType
impl<'de> Deserialize<'de> for MetricType
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
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(value: MetricType) -> Self
fn from(value: MetricType) -> Self
Converts to this type from the input type.
Source§impl From<u32> for MetricType
impl From<u32> for MetricType
Source§impl Hash for MetricType
impl Hash for MetricType
Source§impl PartialEq for MetricType
impl PartialEq for MetricType
Source§impl Serialize for MetricType
impl Serialize for MetricType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more