Skip to main content

TokenKind

Enum TokenKind 

Source
pub enum TokenKind {
Show 212 variants Abs, Acorn, Acosh, After, All, Alter, And, Any, As, Asc, AverageVector, Batch, BestScore, Between, Bool, BottomRight, By, Candidates, Case, Center, Clear, Collection, Collections, Consistency, Context, Cosine, Count, Create, Cross, Datetime, DatetimeKey, Dbsf, Decay, Default, Defaults, Delete, Dense, Desc, Discover, Diversity, Dot, Drop, Else, Embed, Empty, End, Euclid, Except, Exact, Facet, Exclude, Exp, ExpDecay, Exterior, False, Feedback, Field, Filter, Float, For, Formula, From, Fusion, GaussDecay, Geo, GeoBbox, GeoDistance, GeoPolygon, GeoRadius, Global, Group, HasVector, Hnsw, HnswEf, Hybrid, Id, Idf, Ignore, Image, In, Include, Index, InsertOnly, IndexedOnly, Indices, Integer, Interiors, Into, Is, Key, Keys, Keyword, Lat, Limit, LinDecay, Ln, Log, Lon, Lookup, Majority, Manhattan, Match, MatchAny, Max, MaxSelectivity, Metadata, Midpoint, Min, Mmr, Model, Mode, Multi, Multivector, Naive, Nearest, Negative, Nested, Not, Null, Object, Offset, On, Optimizers, Options, Or, Order, Overwrite, Oversampling, Params, Payload, Phrase, Point, Points, Positive, Pow, Prefetch, Prefix, Quantization, Query, Quota, Quotas, Quorum, Radius, Random, Recommend, Relevance, Rerank, Rescore, Rrf, RrfK, RrfWeights, Sample, Scale, Score, Scroll, Set, Shard, Show, Should, Size, Slice, Sparse, Sqrt, Start, Strategy, StrictMode, SumScores, Target, Text, Then, Threshold, Timeout, Tokens, TopLeft, True, Type, Update, UpdateOnly, Upsert, Using, Uuid, Values, ValuesCount, Vector, Wait, Wal, When, Where, With, Star, Identifier, String, Lbrace, Rbrace, Lbracket, Rbracket, Lparen, Rparen, Colon, Comma, Equals, NotEquals, Gt, Gte, Lt, Lte, Plus, Minus, Slash, Semicolon, Question, Eof,
}
Expand description

The lexical token kinds produced by the QQL lexer.

Variants§

§

Abs

The ABS keyword.

§

Acorn

The ACORN keyword.

§

Acosh

The ACOSH keyword.

§

After

The AFTER keyword.

§

All

The ALL keyword.

§

Alter

The ALTER keyword.

§

And

The AND keyword.

§

Any

The ANY keyword.

§

As

The AS keyword.

§

Asc

The ASC keyword.

§

AverageVector

The AVERAGE_VECTOR keyword.

§

Batch

The BATCH keyword.

§

BestScore

The BEST_SCORE keyword.

§

Between

The BETWEEN keyword.

§

Bool

The BOOL keyword.

§

BottomRight

The BOTTOM_RIGHT keyword.

§

By

The BY keyword.

§

Candidates

The CANDIDATES keyword.

§

Case

The CASE keyword.

§

Center

The CENTER keyword.

§

Clear

The CLEAR keyword.

§

Collection

The COLLECTION keyword.

§

Collections

The COLLECTIONS keyword.

§

Consistency

The CONSISTENCY keyword.

§

Context

The CONTEXT keyword.

§

Cosine

The COSINE keyword.

§

Count

The COUNT keyword.

§

Create

The CREATE keyword.

§

Cross

The CROSS keyword.

§

Datetime

The DATETIME keyword.

§

DatetimeKey

The DATETIME_KEY keyword.

§

Dbsf

The DBSF keyword.

§

Decay

The DECAY keyword.

§

Default

The DEFAULT keyword.

§

Defaults

The DEFAULTS keyword.

§

Delete

The DELETE keyword.

§

Dense

The DENSE keyword.

§

Desc

The DESC keyword.

§

Discover

The DISCOVER keyword.

§

Diversity

The DIVERSITY keyword.

§

Dot

The DOT keyword.

§

Drop

The DROP keyword.

§

Else

The ELSE keyword.

§

Embed

The EMBED keyword.

§

Empty

The EMPTY keyword.

§

End

The END keyword.

§

Euclid

The EUCLID keyword.

§

Except

The EXCEPT keyword (used by MATCH EXCEPT).

§

Exact

The EXACT keyword.

§

Facet

The FACET keyword.

§

Exclude

The EXCLUDE keyword.

§

Exp

The EXP keyword.

§

ExpDecay

The EXP_DECAY keyword.

§

Exterior

The EXTERIOR keyword.

§

False

The FALSE keyword.

§

Feedback

The FEEDBACK keyword.

§

Field

The FIELD keyword.

§

Filter

The FILTER keyword (upsert UPDATE FILTER guard).

§

Float

A float literal token; also the FLOAT field-type keyword.

§

For

The FOR keyword.

§

Formula

The FORMULA keyword.

§

From

The FROM keyword.

§

Fusion

The FUSION keyword.

§

GaussDecay

The GAUSS_DECAY keyword.

§

Geo

The GEO keyword.

§

GeoBbox

The GEO_BBOX keyword.

§

GeoDistance

The GEO_DISTANCE keyword.

§

GeoPolygon

The GEO_POLYGON keyword.

§

GeoRadius

The GEO_RADIUS keyword.

§

Global

The GLOBAL keyword.

§

Group

The GROUP keyword.

§

HasVector

The HAS_VECTOR keyword.

§

Hnsw

The HNSW keyword.

§

HnswEf

The HNSW_EF keyword.

§

Hybrid

The HYBRID keyword.

§

Id

The ID keyword.

§

Idf

The IDF keyword.

§

Ignore

The IGNORE keyword.

§

Image

The IMAGE keyword.

§

In

The IN keyword.

§

Include

The INCLUDE keyword.

§

Index

The INDEX keyword.

§

InsertOnly

The INSERT_ONLY keyword (upsert UPDATE MODE value).

§

IndexedOnly

The INDEXED_ONLY keyword.

§

Indices

The INDICES keyword.

§

Integer

An integer literal token; also the INTEGER field-type keyword.

§

Interiors

The INTERIORS keyword.

§

Into

The INTO keyword.

§

Is

The IS keyword.

§

Key

The KEY keyword.

§

Keys

The KEYS keyword.

§

Keyword

The KEYWORD keyword.

§

Lat

The LAT keyword.

§

Limit

The LIMIT keyword.

§

LinDecay

The LIN_DECAY keyword.

§

Ln

The LN keyword.

§

Log

The LOG keyword.

§

Lon

The LON keyword.

§

Lookup

The LOOKUP keyword.

§

Majority

The MAJORITY keyword.

§

Manhattan

The MANHATTAN keyword.

§

Match

The MATCH keyword.

§

MatchAny

The MATCH_ANY keyword.

§

Max

The MAX keyword.

§

MaxSelectivity

The MAX_SELECTIVITY keyword.

§

Metadata

The METADATA keyword.

§

Midpoint

The MIDPOINT keyword.

§

Min

The MIN keyword.

§

Mmr

The MMR keyword.

§

Model

The MODEL keyword.

§

Mode

The MODE keyword (upsert UPDATE MODE guard).

§

Multi

The MULTI keyword.

§

Multivector

The MULTIVECTOR keyword.

§

Naive

The NAIVE keyword.

§

Nearest

The NEAREST keyword.

§

Negative

The NEGATIVE keyword.

§

Nested

The NESTED keyword.

§

Not

The NOT keyword.

§

Null

The NULL keyword.

§

Object

The OBJECT keyword.

§

Offset

The OFFSET keyword.

§

On

The ON keyword.

§

Optimizers

The OPTIMIZERS keyword.

§

Options

The OPTIONS keyword.

§

Or

The OR keyword.

§

Order

The ORDER keyword.

§

Overwrite

The OVERWRITE keyword (payload OVERWRITE flag).

§

Oversampling

The OVERSAMPLING keyword.

§

Params

The PARAMS keyword.

§

Payload

The PAYLOAD keyword.

§

Phrase

The PHRASE keyword.

§

Point

The POINT keyword.

§

Points

The POINTS keyword.

§

Positive

The POSITIVE keyword.

§

Pow

The POW keyword.

§

Prefetch

The PREFETCH keyword.

§

Prefix

The PREFIX keyword.

§

Quantization

The QUANTIZATION keyword.

§

Query

The QUERY keyword.

§

Quota

The QUOTA keyword.

§

Quotas

The QUOTAS keyword.

§

Quorum

The QUORUM keyword.

§

Radius

The RADIUS keyword.

§

Random

The RANDOM keyword.

§

Recommend

The RECOMMEND keyword.

§

Relevance

The RELEVANCE keyword.

§

Rerank

The RERANK keyword.

§

Rescore

The RESCORE keyword.

§

Rrf

The RRF keyword.

§

RrfK

The RRF_K keyword.

§

RrfWeights

The RRF_WEIGHTS keyword.

§

Sample

The SAMPLE keyword.

§

Scale

The SCALE keyword.

§

Score

The SCORE keyword.

§

Scroll

The SCROLL keyword.

§

Set

The SET keyword.

§

Shard

The SHARD keyword.

§

Show

The SHOW keyword.

§

Should

The SHOULD keyword (used by MIN SHOULD).

§

Size

The SIZE keyword.

§

Slice

The SLICE keyword.

§

Sparse

The SPARSE keyword.

§

Sqrt

The SQRT keyword.

§

Start

The START keyword (ORDER BY … START FROM <value> paging origin).

§

Strategy

The STRATEGY keyword.

§

StrictMode

The STRICT_MODE keyword.

§

SumScores

The SUM_SCORES keyword.

§

Target

The TARGET keyword.

§

Text

The TEXT keyword.

§

Then

The THEN keyword.

§

Threshold

The THRESHOLD keyword.

§

Timeout

The TIMEOUT keyword.

§

Tokens

The TOKENS keyword (used by MATCH TOKENS).

§

TopLeft

The TOP_LEFT keyword.

§

True

The TRUE keyword.

§

Type

The TYPE keyword.

§

Update

The UPDATE keyword.

§

UpdateOnly

The UPDATE_ONLY keyword (upsert UPDATE MODE value).

§

Upsert

The UPSERT keyword.

§

Using

The USING keyword.

§

Uuid

The UUID keyword.

§

Values

The VALUES keyword.

§

ValuesCount

The VALUES_COUNT keyword.

§

Vector

The VECTOR keyword.

§

Wait

The WAIT keyword.

§

Wal

The WAL keyword.

§

When

The WHEN keyword.

§

Where

The WHERE keyword.

§

With

The WITH keyword.

§

Star

A * token (wildcard or multiplication).

§

Identifier

An identifier token (field, collection, or parameter name).

§

String

A string literal token (quoted, raw, backtick, or triple-quoted).

§

Lbrace

A { token.

§

Rbrace

A } token.

§

Lbracket

A [ token.

§

Rbracket

A ] token.

§

Lparen

A ( token.

§

Rparen

A ) token.

§

Colon

A : token.

§

Comma

A , token.

§

Equals

An = token.

§

NotEquals

A != token.

§

Gt

A > token.

§

Gte

A >= token.

§

Lt

A < token.

§

Lte

A <= token.

§

Plus

A + token.

§

Minus

A - token.

§

Slash

A / token.

§

Semicolon

A ; token.

§

Question

A ? token.

§

Eof

The end-of-input token.

Implementations§

Source§

impl TokenKind

Source

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

Returns the canonical display string for this token kind.

Source§

impl TokenKind

Source

pub fn is_keyword_or_identifier(&self) -> bool

Returns true for keyword and identifier kinds.

Numeric kinds (Integer / Float) are excluded here: the word spellings FLOAT / INTEGER (field-type keywords mapped onto those kinds) are recovered by Token::is_keyword_or_identifier.

Source

pub fn is_statement_start(&self) -> bool

Keywords that open a top-level statement (parse_stmt match arms).

Source

pub fn is_recovery_sync(&self) -> bool

Panic-mode sync tokens after a parse error.

WITH is omitted: it is both a CTE opener and a clause (WITH PAYLOAD, WITH PARAMS), so treating it as a boundary would split a query at the clause. Missing-semicolon recovery still uses Self::is_statement_start.

Trait Implementations§

Source§

impl Clone for TokenKind

Source§

fn clone(&self) -> TokenKind

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 TokenKind

Source§

impl Debug for TokenKind

Source§

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

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

impl Display for TokenKind

Source§

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

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

impl Eq for TokenKind

Source§

impl PartialEq for TokenKind

Source§

fn eq(&self, other: &TokenKind) -> 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 TokenKind

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.