Expand description
tarantool-rs
- Asyncronous Tokio-based client for Tarantool.
This crate provide async connector and necessary abstractions for interaction with Tarantool instance.
§Example
use tarantool_rs::{Connection, ExecutorExt, IteratorType};
// Create connection to Tarantool instace
let conn = Connection::builder().build("127.0.0.1:3301").await?;
// Execute Lua code with one argument, returning this argument
let number: u64 = conn.eval("return ...", (42, )).await?.decode_result()?;
assert_eq!(number, 42);
// Call Lua function 'rand' (assuming it exists and return 42)
let number: u64 = conn.call("rand", ()).await?.decode_first()?;
assert_eq!(number, 42);
// Get 'clients' space with 2 fields - 'id' and 'name'
let clients_space = conn.space("clients").await?.expect("Space exists");
// Insert tuple into 'clients' space
clients_space.insert((1, "John Doe")).await?;
// Select tuples from clients space using primary index
let clients: Vec<(i64, String)> = clients_space
.select(None, None, None, (1, ))
.await?;
§Features
- authorization
- evaluating Lua expressions
- remote function calling
- CRUD operations
- transaction control (begin/commit/rollback)
- reconnection in background
- SQL requests
- chunked responses
- watchers and events
- connection pooling
- automatic schema fetching and reloading
- graceful shutdown protocol support
- pre Tarantool 2.10 versions support
- customizable connection features (streams/watchers/mvcc)
- custom Tarantool MP types (UUID, …)
- …
Modules§
Structs§
- Call
Response - Tuple, returned from
call
andeval
requests. - Connection
- Connection to Tarantool instance.
- Connection
Builder - Build connection to Tarantool.
- DmoOperation
- Operation in
upsert
orupdate
request. - DmoResponse
- Tuple, returned from all data-manipulation operations (insert, update, upsert, replace, delete).
- Prepared
SqlStatement - SqlResponse
- Response, returned from SQL requests.
- Stream
- Abstraction, providing sequential processing of requests.
- Transaction
- Started transaction (docs).
- Transaction
Builder - Build transaction.
Enums§
- Error
- Represents all possible errors of this crate.
- Iterator
Type - Iterator type for
select
requests. - Reconnect
Interval - Interval parameters for background reconnection.
- Transaction
Isolation Level - Transaction isolation level.
- Value
- Represents any valid MessagePack value.
Traits§
- Executor
- Type, which can make requests to Tarantool and create streams and transactions.
- Executor
Ext - Helper trait around
Executor
trait, which allows to send specific requests with any type, implementingExecitor
trait. - Tuple
- Trait, describing type, which can be encoded into MessagePack tuple.
- Tuple
Element
Type Aliases§
- Result
- Alias for
std::result::Result<T, crate::Error>
.