Struct ql2::Term[][src]

pub struct Term {
    pub type: Option<i32>,
    pub datum: Option<Datum>,
    pub args: Vec<Term>,
    pub optargs: Vec<AssocPair>,
}
Expand description

A [Term] is either a piece of data (see Datum above), or an operator and its operands. If you have a [Datum], it’s stored in the member [datum]. If you have an operator, its positional arguments are stored in [args] and its optional arguments are stored in [optargs].

A note about type signatures: We use the following notation to denote types: arg1_type, arg2_type, argrest_type… -> result_type So, for example, if we have a function avg that takes any number of arguments and averages them, we might write: NUMBER… -> NUMBER Or if we had a function that took one number modulo another: NUMBER, NUMBER -> NUMBER Or a function that takes a table and a primary key of any Datum type, then retrieves the entry with that primary key: Table, DATUM -> OBJECT Some arguments must be provided as literal values (and not the results of sub terms). These are marked with a !. Optional arguments are specified within curly braces as argname : value type (e.x {noreply:BOOL}) Many RQL operations are polymorphic. For these, alterantive type signatures are separated by |.

The RQL type hierarchy is as follows: Top DATUM NULL BOOL NUMBER STRING OBJECT SingleSelection ARRAY Sequence ARRAY Stream StreamSelection Table Database Function Ordering - used only by ORDER_BY Pathspec – an object, string, or array that specifies a path Error

Fields

type: Option<i32>datum: Option<Datum>

This is only used when type is DATUM.

args: Vec<Term>

Holds the positional arguments of the query.

optargs: Vec<AssocPair>

Holds the optional arguments of the query.

Implementations

Returns the enum value of type, or the default if the field is unset or set to an invalid enum value.

Sets type to the provided enum value.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Returns the encoded length of the message without a length delimiter.

Clears the message, resetting all fields to their default.

Encodes the message to a buffer. Read more

Encodes the message to a newly allocated buffer.

Encodes the message with a length-delimiter to a buffer. Read more

Encodes the message with a length-delimiter to a newly allocated buffer.

Decodes an instance of the message from a buffer. Read more

Decodes a length-delimited instance of the message from the buffer.

Decodes an instance of the message from a buffer, and merges it into self. Read more

Decodes a length-delimited instance of the message from buffer, and merges it into self. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. 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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.