1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! **cdrs** is a native Cassandra DB client written in Rust.
//!
//! ## Getting started
//!
//! This example configures a cluster consisting of a single node, and uses round-robin load balancing.
//!
//! ```no_run
//! use cdrs_tokio::cluster::session::{TcpSessionBuilder, SessionBuilder};
//! use cdrs_tokio::cluster::NodeTcpConfigBuilder;
//! use cdrs_tokio::load_balancing::RoundRobinLoadBalancingStrategy;
//! use std::sync::Arc;
//!
//! #[tokio::main]
//! async fn main() {
//! let cluster_config = NodeTcpConfigBuilder::new()
//! .with_contact_point("127.0.0.1:9042".into())
//! .build()
//! .await
//! .unwrap();
//! let session = TcpSessionBuilder::new(RoundRobinLoadBalancingStrategy::new(), cluster_config)
//! .build()
//! .await
//! .unwrap();
//!
//! let create_ks = "CREATE KEYSPACE IF NOT EXISTS test_ks WITH REPLICATION = { \
//! 'class' : 'SimpleStrategy', 'replication_factor' : 1 };";
//! session
//! .query(create_ks)
//! .await
//! .expect("Keyspace create error");
//! }
//! ```
//!
//! ## Nodes and load balancing
//!
//! In order to maximize efficiency, the driver needs to be appropriately configured for given use
//! case. Please look at available [load balancers](crate::load_balancing) and
//! [node distance evaluators](crate::load_balancing::node_distance_evaluator) to pick the optimal
//! solution when building the [`Session`](crate::cluster::session::Session). Topology-aware load
//! balancing is preferred when dealing with multi-node clusters, otherwise simpler strategies might
//! prove more efficient.
pub use authenticators;
pub use compression;
pub use consistency;
pub use error;
pub use frame;
pub use query;
pub use types;
pub type Error = Error;
pub type Result<T> = Result;
pub use ;