Struct reql::r

source ·
pub struct r;
Expand description

The top-level ReQL namespace

Example

Set up your top-level namespace.

use reql::r;

Implementations§

source§

impl r

source

pub async fn connect<T>(self, options: T) -> Result<Session>where T: Arg,

Create a new connection to the database server

Example

Open a connection using the default host and port, specifying the default database.

use reql::{r, cmd::connect::Options};

let session = r.connect(Options::new().db("marvel")).await?;

Read more about this command connect

source

pub fn db_create<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn db_drop<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn db_list(self) -> Command

source

pub fn db<T>(self, arg: T) -> Commandwhere T: Arg,

Reference a database

The db command is optional. If it is not present in a query, the query will run against the default database for the connection, specified in the db argument to connect.

Examples

Explicitly specify a database for a query.

r.db("heroes").table("marvel").run(conn)
source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

pub fn literal<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn object<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn random<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn round<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn ceil<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn floor<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn now(self) -> Command

source

pub fn time<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn epoch_time<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn iso8601<T>(self, arg: T) -> Commandwhere T: Arg,

source

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

source

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

source

pub fn range<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn error<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn expr<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn js<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn info<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn json<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn http<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn uuid<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn circle<T>(self, arg: T) -> Commandwhere T: Arg,

source

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

source

pub fn geojson<T>(self, arg: T) -> Commandwhere T: Arg,

source

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

source

pub fn line<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn point<T>(self, arg: T) -> Commandwhere T: Arg,

source

pub fn polygon<T>(self, arg: T) -> Commandwhere T: Arg,

source

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

source

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

source

pub fn asc<T>(self, arg: T) -> Ascwhere T: Arg,

source

pub fn desc<T>(self, arg: T) -> Descwhere T: Arg,

source

pub fn index<T>(self, arg: T) -> Indexwhere T: Arg,

source

pub fn args<T>(self, arg: T) -> Args<T>

Auto Trait Implementations§

§

impl RefUnwindSafe for r

§

impl Send for r

§

impl Sync for r

§

impl Unpin for r

§

impl UnwindSafe for r

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, 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