Skip to main content

Slot

Struct Slot 

Source
pub struct Slot {
    pub field: Ident,
    pub engine: Ident,
}
Expand description

ONE SLOT: a field and the engine that holds it.

§Slot identity moved, and this type is the move

It used to be the DECLARATION — one FulltextTable::SLOT per index, and one declaration, one slot was the keystone the brand rested on. Under the engine grammar it is (field × engine), and the per-slot laws follow it there: ONE Tantivy index per slot, because BM25’s corpus statistics are index-wide, is now one index per (field, engine) — which is what makes two fields of one declaration searchable independently without their scores moving under each other.

The COLUMN axis is unchanged and is one grain finer: a vector slot may still hold several columns, and VectorColumn still says which one a knn runs over. What this type adds is the axis above it, not a replacement for the one below.

Fields§

§field: Ident

The elected field.

§engine: Ident

The engine word — as WRITTEN, since a free word has no other spelling.

Implementations§

Source§

impl Slot

Source

pub fn name(&self, index: &Ident) -> String

This slot’s durable NAME, as the emission mints it: <index>__<field>__<engine>.

§Why all three parts, and why the double underscore

A slot name reaches a directory, a table or a virtual table, so two slots sharing one is two declarations sharing a corpus — the exact class the brand exists to keep out. All three parts are therefore in the name: two indexes may declare a field of the same name, and one field may name several engines.

The separator is __ because a single one is legal INSIDE each part — image_embedding is a field name — so a single-underscore join would let a_b × c and a × b_c mint one name. It is not the framework’s __…__ fence: that reservation is both ends, and this name has neither.

SNAKE CASE from the index’s own name, which is the convention RecordModel::table_name already defaults a table to — one convention for every durable name a declaration mints.

Source

pub fn marker(&self, index: &Ident) -> Ident

The ZERO-SIZED TYPE this slot is carried as — <Index><Field><Engine>.

A TYPE and not a name, for the reason the election markers are types: a handle branded with a slot cannot be handed to another slot’s door, and a brand is a fact carried through the types. A SlotName alone would put the pairing back in a value, where a swap is a runtime mistake nobody sees.

Trait Implementations§

Source§

impl Clone for Slot

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 Debug for Slot

Source§

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

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

impl Eq for Slot

Source§

impl PartialEq for Slot

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 Slot

Auto Trait Implementations§

§

impl !Send for Slot

§

impl !Sync for Slot

§

impl Freeze for Slot

§

impl RefUnwindSafe for Slot

§

impl Unpin for Slot

§

impl UnsafeUnpin for Slot

§

impl UnwindSafe for Slot

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.