Skip to main content

VecMeta

Struct VecMeta 

Source
pub struct VecMeta {
    pub dim: u64,
    pub seed: u64,
    pub bits: u64,
    pub max: u64,
    pub medoid: u64,
    pub watermark: u64,
}
Expand description

Everything one vector field needs to be read back correctly, in one row (keys::catalog_field(CAT_VEC, field)). Nothing here is derivable from the vectors:

  • dim is the field’s width; a row of another width is corruption at birth, refused rather than discovered as a garbage distance later.
  • seed and bits ARE the fingerprint recipe – (dim, seed, bits) is the whole of it, so any process, at any later date, re-derives the encoder that wrote the codes rather than the one the code’s defaults happen to produce that day.
  • max is the highest id that ever carried a vector for this field. nearest_par partitions [1, max]; next_id is wrong for it when vectors are set on caller-managed ids with no nodes (caught by the parallel-vs-serial equality test: partitions covered almost nothing and the test diverged).
  • medoid and watermark are the nav tier’s start point and fast resume point. 0 means “no graph yet”, which is a usable sentinel because the id allocator reserves 0 and hands out nothing below 1. The watermark rides each fold insert; ids written behind it are recorded separately in CAT_NAV_PENDING, so a crash resumes from facts rather than ordering.

Fields§

§dim: u64§seed: u64§bits: u64§max: u64§medoid: u64§watermark: u64

Implementations§

Source§

impl VecMeta

Source

pub const LEN: usize = 48

Six big-endian words. Fixed width: a short row is a row this build cannot read, and reading it half-way would hand out a recipe that decodes every code in the field wrongly.

Source

pub fn encode(&self) -> Vec<u8> ⓘ

Source

pub fn decode(b: &[u8]) -> Option<VecMeta>

Trait Implementations§

Source§

impl Clone for VecMeta

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for VecMeta

Source§

impl Debug for VecMeta

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for VecMeta

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for VecMeta

Source§

impl PartialEq for VecMeta

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for VecMeta

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.