pub struct Fp32Codec { /* private fields */ }Expand description
Identity codec: 4 bytes/dim, exact. The verification anchor of the plane.
Implementations§
Trait Implementations§
Source§impl VectorCodec for Fp32Codec
impl VectorCodec for Fp32Codec
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Bytes per encoded vector.
Source§fn encode(&self, v: &[f32]) -> Result<Vec<u8>>
fn encode(&self, v: &[f32]) -> Result<Vec<u8>>
Encode a vector. The blob is self-sufficient for scoring.
Source§fn decode(&self, blob: &[u8]) -> Result<Vec<f32>>
fn decode(&self, blob: &[u8]) -> Result<Vec<f32>>
Reconstruct an approximation (exact only for
Fp32).Source§fn distance(&self, a: &[u8], b: &[u8]) -> Result<f32>
fn distance(&self, a: &[u8], b: &[u8]) -> Result<f32>
Symmetric blob×blob distance under this codec’s metric.
Source§fn make_query(&self, q: &[f32]) -> Result<Box<dyn EncodedQuery>>
fn make_query(&self, q: &[f32]) -> Result<Box<dyn EncodedQuery>>
Prepare a query for repeated asymmetric scoring against blobs.
Auto Trait Implementations§
impl Freeze for Fp32Codec
impl RefUnwindSafe for Fp32Codec
impl Send for Fp32Codec
impl Sync for Fp32Codec
impl Unpin for Fp32Codec
impl UnsafeUnpin for Fp32Codec
impl UnwindSafe for Fp32Codec
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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