Enum Argument

Source
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§

Source§

impl Debug for Argument

Source§

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

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

impl PartialEq for Argument

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Argument

Source§

impl StructuralPartialEq for Argument

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.