Struct reql::Command

source ·
pub struct Command { /* private fields */ }
Expand description

The query that will be sent to RethinkDB

Implementations§

source§

impl<'a> Command

source

pub fn changes<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn table_create<T>(self, arg: T) -> Selfwhere T: Arg,

Create a table

A RethinkDB table is a collection of JSON documents.

Example

Create a table named “dc_universe” with the default settings.

r.db("heroes").table_create("dc_universe").run(conn)
   {
       "config_changes": [
           {
               "new_val": {
                   "db": "test",
                   "durability":  "hard",
                   "id": "20ea60d4-3b76-4817-8828-98a236df0297",
                   "name": "dc_universe",
                   "primary_key": "id",
                   "shards": [
                       {
                           "primary_replica": "rethinkdb_srv1",
                           "replicas": [
                               "rethinkdb_srv1",
                               "rethinkdb_srv2"
                           ]
                       }
                   ],
                   "write_acks": "majority"
               },
               "old_val": None
           }
       ],
       "tables_created": 1
   }
       ```
         
source

pub fn table_drop<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn table_list(self) -> Self

source

pub fn table<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn index_create<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn index_drop<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn index_list(self) -> Self

source

pub fn index_rename<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn index_status<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn index_wait<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn set_write_hook<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn get_write_hook(self) -> Self

source

pub fn insert<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn update<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn replace<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn delete<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn sync(self) -> Self

source

pub fn get<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn get_all<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn between<T>(self, arg: T) -> Selfwhere T: Arg<'a>,

source

pub fn filter<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn inner_join<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn outer_join<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn eq_join<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn zip(self) -> Self

source

pub fn map<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn with_fields<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn concat_map<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn order_by<T>(self, arg: T) -> Selfwhere T: Arg,

Orders the result based on the given column.

Argument can either be a string, r.asc("column") for ascending or r.desc("column") for descending. If the given argument is a string, the direction will default to ascending.

Example

Sort the result in descending order based on the created_at column.

r.db("database").table("users").order_by(r.desc("created_at")).run(conn)
source

pub fn skip<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn limit<T>(self, arg: T) -> Selfwhere T: Arg,

Limits the result set to the given amount.

Argument can be an isize.

Example

Get 5 records.

r.db("database").table("users").limit(5).run(conn)
source

pub fn slice<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn nth<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn offsets_of<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn is_empty(self) -> Self

source

pub fn union<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn sample<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn group<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn ungroup(self) -> Self

source

pub fn reduce<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn fold<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn count<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn sum<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn avg<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn min<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn max<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn distinct<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn contains<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn pluck<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn without<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn merge<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn append<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn prepend<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn difference<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn set_insert<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn set_union<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn set_intersection<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn set_difference<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn bracket<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn get_field<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn has_fields<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn insert_at<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn splice_at<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn delete_at<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn change_at<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn keys(self) -> Self

source

pub fn values(self) -> Self

source

pub fn match_<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn split<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn upcase(self) -> Self

source

pub fn downcase(self) -> Self

source

pub fn and<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn or<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn eq<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn ne<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn gt<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn ge<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn lt<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn le<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn not<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn bit_and<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn bit_or<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn bit_xor<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn bit_not(self) -> Self

source

pub fn bit_sal<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn bit_sar<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn round(self) -> Self

source

pub fn ceil(self) -> Self

source

pub fn floor(self) -> Self

source

pub fn in_timezone<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn timezone(self) -> Self

source

pub fn during<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn date(self) -> Self

source

pub fn time_of_day(self) -> Self

source

pub fn year(self) -> Self

source

pub fn month(self) -> Self

source

pub fn day(self) -> Self

source

pub fn day_of_week(self) -> Self

source

pub fn day_of_year(self) -> Self

source

pub fn hours(self) -> Self

source

pub fn minutes(self) -> Self

source

pub fn seconds(self) -> Self

source

pub fn to_iso8601(self) -> Self

source

pub fn to_epoch_time(self) -> Self

source

pub fn binary<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn do_<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn branch<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn for_each<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn default<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn coerce_to<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn type_of(self) -> Self

source

pub fn info(self) -> Self

source

pub fn to_json(self) -> Self

source

pub fn distance<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn fill(self) -> Self

source

pub fn to_geojson(self) -> Self

source

pub fn get_intersecting<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn get_nearest<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn includes<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn intersects<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn polygon_sub<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn grant<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn config(self) -> Self

source

pub fn rebalance(self) -> Self

source

pub fn reconfigure<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn status(self) -> Self

source

pub fn wait<T>(self, arg: T) -> Selfwhere T: Arg,

source

pub fn run<A, T>(self, arg: A) -> impl Stream<Item = Result<T>>where A: Arg, T: Unpin + DeserializeOwned,

Trait Implementations§

source§

impl<T> Add<T> for Commandwhere T: Arg,

§

type Output = Command

The resulting type after applying the + operator.
source§

fn add(self, arg: T) -> Self

Performs the + operation. Read more
source§

impl<'a> Arg<'a> for Command

source§

fn arg(self) -> Arg<Options<'a>>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<Options>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<Options>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<Options>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<Options>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<Options>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<Options>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<Options>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<Options>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self) -> Arg<()>

source§

impl Arg for Command

source§

fn arg(self, parent: Option<Command>) -> Arg<()>

source§

impl<T> BitAnd<T> for Commandwhere T: Arg,

§

type Output = Command

The resulting type after applying the & operator.
source§

fn bitand(self, arg: T) -> Self

Performs the & operation. Read more
source§

impl<T> BitOr<T> for Commandwhere T: Arg,

§

type Output = Command

The resulting type after applying the | operator.
source§

fn bitor(self, arg: T) -> Self

Performs the | operation. Read more
source§

impl<T> BitXor<T> for Commandwhere T: Arg,

§

type Output = Command

The resulting type after applying the ^ operator.
source§

fn bitxor(self, arg: T) -> Self

Performs the ^ operation. Read more
source§

impl Clone for Command

source§

fn clone(&self) -> Command

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Command

source§

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

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

impl<T> Div<T> for Commandwhere T: Arg,

§

type Output = Command

The resulting type after applying the / operator.
source§

fn div(self, arg: T) -> Self

Performs the / operation. Read more
source§

impl<const N: usize> From<[Command; N]> for Command

source§

fn from(arr: [Command; N]) -> Self

Converts to this type from the input type.
source§

impl From<Result<Datum, Error>> for Command

source§

fn from(result: Result<Datum>) -> Self

Converts to this type from the input type.
source§

impl<T> Mul<T> for Commandwhere T: Arg,

§

type Output = Command

The resulting type after applying the * operator.
source§

fn mul(self, arg: T) -> Self

Performs the * operation. Read more
source§

impl Not for Command

§

type Output = Command

The resulting type after applying the ! operator.
source§

fn not(self) -> Self

Performs the unary ! operation. Read more
source§

impl<T> Rem<T> for Commandwhere T: Arg,

§

type Output = Command

The resulting type after applying the % operator.
source§

fn rem(self, arg: T) -> Self

Performs the % operation. Read more
source§

impl<T> Sub<T> for Commandwhere T: Arg,

§

type Output = Command

The resulting type after applying the - operator.
source§

fn sub(self, arg: T) -> Self

Performs the - operation. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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 Twhere T: Clone,

§

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

§

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 Twhere U: TryFrom<T>,

§

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

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more