pub struct Client(/* private fields */);
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
impl Client
sourcepub async fn connect_with_config(
url: &str,
port: u16,
config: Config
) -> Result<Self, Error>
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
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,
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,
source§fn 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.
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,
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,
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,
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.
Auto Trait Implementations§
impl Freeze for Client
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more