pub struct Client(_);
Expand description

Actual client that can be used to send and receive messages to tarantool instance.

Can be cloned and moved into different fibers for connection to be reused.

See super::client for examples and AsClient trait for API.

Implementations§

source§

impl Client

source

pub async fn connect(url: &str, port: u16) -> Result<Self, Error>

Creates a new client and tries to establish connection to url:port

Errors

Error is returned if an attempt to connect failed. See Error.

source

pub async fn connect_with_config( url: &str, port: u16, config: Config ) -> Result<Self, Error>

Creates a new client and tries to establish connection to url:port

Takes explicit config in comparison to Client::connect where default values are used.

Errors

Error is returned if an attempt to connect failed. See Error.

Trait Implementations§

source§

impl AsClient for Client

source§

fn send<'life0, 'life1, 'async_trait, R>( &'life0 self, request: &'life1 R ) -> Pin<Box<dyn Future<Output = Result<R::Response, Error>> + 'async_trait>>where R: 'async_trait + Request, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send Request and wait for response. This function yields. Read more
source§

fn ping<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Execute a PING command.
source§

fn call<'life0, 'life1, 'life2, 'async_trait, T>( &'life0 self, fn_name: &'life1 str, args: &'life2 T ) -> Pin<Box<dyn Future<Output = Result<Tuple, Error>> + 'async_trait>>where T: ToTupleBuffer + ?Sized + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Call a remote stored procedure. Read more
source§

fn eval<'life0, 'life1, 'life2, 'async_trait, T>( &'life0 self, expr: &'life1 str, args: &'life2 T ) -> Pin<Box<dyn Future<Output = Result<Tuple, Error>> + 'async_trait>>where T: ToTupleBuffer + ?Sized + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Evaluates and executes the expression in Lua-string, which may be any statement or series of statements. Read more
source§

fn execute<'life0, 'life1, 'life2, 'async_trait, T>( &'life0 self, sql: &'life1 str, bind_params: &'life2 T, limit: Option<usize> ) -> Pin<Box<dyn Future<Output = Result<Vec<Tuple>, Error>> + 'async_trait>>where T: ToTupleBuffer + ?Sized + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Execute sql query remotely.
source§

impl Clone for Client

source§

fn clone(&self) -> Self

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 Client

source§

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

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

impl Drop for Client

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Client

§

impl !Send for Client

§

impl !Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

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, 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> IntoClones<(T,)> for Twhere T: Clone,

source§

impl<T> IntoClones<(T, T)> for Twhere T: Clone,

source§

impl<T> IntoClones<(T, T, T)> for Twhere T: Clone,

source§

impl<T> IntoClones<(T, T, T, T)> for Twhere T: Clone,

source§

impl<T> IntoClones<(T, T, T, T, T)> for Twhere T: Clone,

source§

impl<T> IntoClones<(T, T, T, T, T, T)> for Twhere T: Clone,

source§

impl<T> IntoClones<(T, T, T, T, T, T, T)> for Twhere T: Clone,

source§

impl<T> IntoClones<(T, T, T, T, T, T, T, T)> for Twhere T: Clone,

source§

impl<T> IntoClones<(T, T, T, T, T, T, T, T, T)> for Twhere T: Clone,

source§

impl<T> IntoClones<(T, T, T, T, T, T, T, T, T, T)> for Twhere T: Clone,

source§

impl<T> IntoClones<(T, T, T, T, T, T, T, T, T, T, T)> for Twhere T: Clone,

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
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.