pub trait AsClient {
// Required method
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;
// Provided methods
fn ping<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
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 { ... }
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 { ... }
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 { ... }
}
Expand description
Generic API for an entity that behaves as Tarantool Client.
Required Methods§
Provided Methods§
sourcefn ping<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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.
sourcefn 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,
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.
conn.call("func", &("1", "2", "3"))
is the remote-call equivalent of func('1', '2', '3')
.
That is, conn.call
is a remote stored-procedure call.
The return from conn.call
is whatever the function returns.
sourcefn 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,
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.
An execute privilege is required; if the user does not have it, an administrator may grant it with
box.schema.user.grant(username, 'execute', 'universe')
.
To ensure that the return from eval
is whatever the Lua expression returns, begin the Lua-string with the
word return
.
sourcefn 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,
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.
Object Safety§
This trait is not object safe.