pub enum VectorDistance {
Cosine,
Euclidean,
}Variants§
Implementations§
Source§impl VectorDistance
impl VectorDistance
pub fn from_function_name(name: &str) -> Option<VectorDistance>
pub const fn function_name(self) -> &'static str
pub fn distance( self, left: VectorRef<'_>, right: VectorRef<'_>, ) -> Result<f64, HawDBError>
Sourcepub fn distance_with_work(
self,
left: VectorRef<'_>,
right: VectorRef<'_>,
checkpoint: impl FnMut() -> Result<(), HawDBError>,
) -> Result<f64, HawDBError>
pub fn distance_with_work( self, left: VectorRef<'_>, right: VectorRef<'_>, checkpoint: impl FnMut() -> Result<(), HawDBError>, ) -> Result<f64, HawDBError>
Cooperatively scores canonical values without copying their payloads.
Sourcepub fn distance_slices_with_work(
self,
left: &[f32],
right: &[f32],
checkpoint: impl FnMut() -> Result<(), HawDBError>,
) -> Result<f64, HawDBError>
pub fn distance_slices_with_work( self, left: &[f32], right: &[f32], checkpoint: impl FnMut() -> Result<(), HawDBError>, ) -> Result<f64, HawDBError>
Scores admitted raw projection vectors with the same mathematical contract as SQL/Cypher, without creating canonical payload copies.
Sourcepub fn distance_slice_to_vector_with_work(
self,
left: &[f32],
right: VectorRef<'_>,
checkpoint: impl FnMut() -> Result<(), HawDBError>,
) -> Result<f64, HawDBError>
pub fn distance_slice_to_vector_with_work( self, left: &[f32], right: VectorRef<'_>, checkpoint: impl FnMut() -> Result<(), HawDBError>, ) -> Result<f64, HawDBError>
Scores a raw query against a validated, byte-backed immutable vector without allocating an aligned coordinate copy.
pub fn evaluate( self, left: ValueRef<'_>, right: ValueRef<'_>, ) -> Result<Option<f64>, HawDBError>
Trait Implementations§
Source§impl Clone for VectorDistance
impl Clone for VectorDistance
Source§fn clone(&self) -> VectorDistance
fn clone(&self) -> VectorDistance
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 VectorDistance
Source§impl Debug for VectorDistance
impl Debug for VectorDistance
impl Eq for VectorDistance
Source§impl From<ProjectionMetric> for VectorDistance
impl From<ProjectionMetric> for VectorDistance
Source§fn from(metric: ProjectionMetric) -> VectorDistance
fn from(metric: ProjectionMetric) -> VectorDistance
Converts to this type from the input type.
Source§impl Hash for VectorDistance
impl Hash for VectorDistance
Source§impl PartialEq for VectorDistance
impl PartialEq for VectorDistance
impl StructuralPartialEq for VectorDistance
Auto Trait Implementations§
impl Forget for VectorDistance
impl Freeze for VectorDistance
impl Move for VectorDistance
impl RefUnwindSafe for VectorDistance
impl Send for VectorDistance
impl Sync for VectorDistance
impl Unpin for VectorDistance
impl UnsafeUnpin for VectorDistance
impl UnwindSafe for VectorDistance
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,
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