pub enum Argument {
    Column(ColumnDeclaration),
    Config(ConfigOption),
}
Expand description

A successfully parsed Argument from a virtual table constructor. A single constructor can have multiple arguments, this struct only represents a single one.

In this parser, the above constructor in xxx has 5 arguments - 2 “configuration options” and “column declarations.” The mode argument is a configuration option with a key of "mode" and a quoted string value of "production". Similarly, state is a configuration argument with key "state" and a bareword value of null. On the other hand, name, age, and progress are arguments that declare columns, with declared types text, integer, and real, respectfully.

The virtual table implementations can do whatever they want with the parsed arguments, including by not limited to erroring on invalid options, creating new columns on the virtual table based on the column definitions, requiring certain config options, or anything else they want. A single parsed argument from a virtual table constructor. Can be a column declaration onf configuration option.

Variants§

§

Column(ColumnDeclaration)

The argument declares a column - ex “name text” or “age integer”. Like SQLite, a column declartion can have 0 or any declared types, and also tries to capture any “constraints”.

§

Config(ConfigOption)

The argument defines a configuration option - ex “mode=fast” or “tokenize = ‘porter ascii’”. The key is always a string, the value can be “rich” types like strings, booleans, numbers, sqlite_parameters, or barewords.

Trait Implementations§

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.