Skip to main content

EngineKind

Enum EngineKind 

Source
pub enum EngineKind {
    Tantivy,
    Fs,
}
Expand description

An engine ingraph itself ships — the words that SELF-BIND under a feature of the framework’s own.

§Why a table at all, when the vocabulary is open

Three facts are true of a shipped word and of no other, and each of them is a refusal or an emission that has to know:

  1. it names a CONCRETE type this crate can spell, so the impls naming one ride gate — the record side’s law, applied to the engine axis;
  2. it is a KIND, and kind is said ONCE — at the resource. So the word at an ELECTION is a named refusal whichever kind it serves, and serves is what lets that sentence say what the word actually holds. (It was a kind-GUARDED refusal while the word self-bound at the election; the resource axis dropped the guard and kept the reading.)
  3. it is ALREADY BOUND, so engines(tantivy = "…") at a graph root is a refusal — rebinding a shipped word would give one word two meanings in one program.

A word outside this table is none of those things and is refused for none of them.

§It has TWO members, and that is a measurement rather than a stub

ingraph ships exactly two engine implementations: TantivyFulltext under feature = "tantivy", and the local-filesystem blob store under NO feature at all. There is no VectorEngine implementation in this workspace — lance appears in this repository only in prose and in the unbuilt legacy/ reference — so the vector side of the grammar is served entirely by the open half, which is the strongest argument the open half has.

Variants§

§

Tantivy

Tantivy, the shipped FULL-TEXT engine.

§

Fs

The local filesystem, the shipped ARTIFACT store.

Implementations§

Source§

impl EngineKind

Source

pub const ALL: [Self; 2]

Every shipped engine, in the order a refusal lists them.

Source

pub const fn as_str(self) -> &'static str

The word a declaration writes.

Source

pub const fn serves(self) -> NodeKind

WHICH KIND of declaration this engine serves.

A full-text engine holds documents and a vector engine holds coordinates, and the two seams are different traits. It is read in two places and means the same thing in both: the BLOB walk refuses a word of another family outright, and the ELECTION’s retirement sentence — which refuses every shipped word, its own kind included — spends it to say what the word holds and therefore which #[ingraph::resource(…)] declaration to write instead.

Source

pub fn gate(self) -> Option<Ident>

The CONDITIONAL-EXPANSION gate this engine’s concrete impls ride — if_tantivy, reached on ingraph’s __private::gate shelf.

Mechanical from as_str, exactly as DatabaseKind::gate is: the word the declaration writes, the word the framework’s feature carries and the word the gate is named after are ONE word, so the three cannot drift into naming different engines.

This is the MEASURED mechanism of ruling 2, mirrored rather than reinvented. What it buys is what it buys on the record side: a declaration naming two engines in a build carrying one is bound to the one, and the other has no impl at all — E0277 for a party that asks and silence for one that does not.

§None for an engine under no feature

fs is at the root under nothing — a backend that needs no feature having no gate to carry, which is ingraph’s own sentence about it — so there is no if_fs and a caller that wrapped its impls in one would name a macro that does not exist. An engine with no feature is always compiled in, which is the same answer the gate would have given, reached without inventing one.

Source

pub fn of(word: &Ident) -> Option<Self>

The word, if it is a shipped one.

Trait Implementations§

Source§

impl Clone for EngineKind

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 EngineKind

Source§

impl Debug for EngineKind

Source§

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

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

impl Eq for EngineKind

Source§

impl Hash for EngineKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for EngineKind

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for EngineKind

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 PartialOrd for EngineKind

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for EngineKind

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.