pub struct EncodedVector {
pub centroid_id: u32,
pub codes: Vec<u8>,
}Expand description
A single encoded token: a centroid reference plus a bit-packed buffer of per-dim bucket codes.
The codes buffer holds dim quantization codes packed LSB-first
at nbits bits each. For the supported widths of 1, 2, 4, and 8
bits the buffer length is (dim * nbits) / 8 (dim is expected to
be a multiple of 8/nbits so code positions don’t span bytes —
ColBERT dims are 128 or 96, which satisfies that constraint for
every supported nbits).
Fields§
§centroid_id: u32Index of the coarse centroid this token was quantized against.
codes: Vec<u8>Bit-packed bucket codes. Use [ResidualCodec::read_code] or the
codec’s decode_vector to pull values out.
Trait Implementations§
Source§impl Clone for EncodedVector
impl Clone for EncodedVector
Source§fn clone(&self) -> EncodedVector
fn clone(&self) -> EncodedVector
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 moreSource§impl Debug for EncodedVector
impl Debug for EncodedVector
impl Eq for EncodedVector
Source§impl PartialEq for EncodedVector
impl PartialEq for EncodedVector
impl StructuralPartialEq for EncodedVector
Auto Trait Implementations§
impl Freeze for EncodedVector
impl RefUnwindSafe for EncodedVector
impl Send for EncodedVector
impl Sync for EncodedVector
impl Unpin for EncodedVector
impl UnsafeUnpin for EncodedVector
impl UnwindSafe for EncodedVector
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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