Struct ql2::Term [−][src]
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
impl Term
[src]
pub fn type(&self) -> TermType
[src]
Returns the enum value of type
, or the default if the field is unset or set to an invalid enum value.
pub fn set_type(&mut self, value: TermType)
[src]
Sets type
to the provided enum value.
Trait Implementations
impl Clone for Term
[src]
impl Debug for Term
[src]
impl Default for Term
[src]
impl<'de> Deserialize<'de> for Term
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Message for Term
[src]
fn encode_raw<B>(&self, buf: &mut B) where
B: BufMut,
[src]
B: BufMut,
fn merge_field<B>(
&mut self,
tag: u32,
wire_type: WireType,
buf: &mut B,
ctx: DecodeContext
) -> Result<(), DecodeError> where
B: Buf,
[src]
&mut self,
tag: u32,
wire_type: WireType,
buf: &mut B,
ctx: DecodeContext
) -> Result<(), DecodeError> where
B: Buf,
fn encoded_len(&self) -> usize
[src]
fn clear(&mut self)
[src]
pub fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
[src]
B: BufMut,
pub fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
[src]
B: BufMut,
pub fn decode<B>(buf: B) -> Result<Self, DecodeError> where
Self: Default,
B: Buf,
[src]
Self: Default,
B: Buf,
pub fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
Self: Default,
B: Buf,
[src]
Self: Default,
B: Buf,
pub fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
[src]
B: Buf,
pub fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
[src]
B: Buf,
impl PartialEq<Term> for Term
[src]
impl Serialize for Term
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Term
[src]
Auto Trait Implementations
impl RefUnwindSafe for Term
impl Send for Term
impl Sync for Term
impl Unpin for Term
impl UnwindSafe for Term
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,