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
use r2d2;
use std::cell;
#[cfg(feature = "ssl")]
mod config_ssl;
mod config_tcp;
mod pager;
pub mod session;
#[cfg(feature = "ssl")]
mod ssl_connection_pool;
mod tcp_connection_pool;
#[cfg(feature = "ssl")]
pub use crate::cluster::config_ssl::{ClusterSslConfig, NodeSslConfig, NodeSslConfigBuilder};
pub use crate::cluster::config_tcp::{ClusterTcpConfig, NodeTcpConfig, NodeTcpConfigBuilder};
pub use crate::cluster::pager::{PagerState, QueryPager, SessionPager};
#[cfg(feature = "ssl")]
pub use crate::cluster::ssl_connection_pool::{
new_ssl_pool, SslConnectionPool, SslConnectionsManager,
};
pub use crate::cluster::tcp_connection_pool::{
new_tcp_pool, startup, TcpConnectionPool, TcpConnectionsManager,
};
use crate::compression::Compression;
use crate::error;
use crate::query::{BatchExecutor, ExecExecutor, PrepareExecutor, QueryExecutor};
use crate::transport::CDRSTransport;
pub trait GetConnection<
T: CDRSTransport + Send + Sync + 'static,
M: r2d2::ManageConnection<Connection = cell::RefCell<T>, Error = error::Error>,
>
{
fn get_connection(&self) -> Option<r2d2::PooledConnection<M>>;
}
pub trait GetCompressor<'a> {
fn get_compressor(&self) -> Compression;
}
pub trait CDRSSession<
'a,
T: CDRSTransport + 'static,
M: r2d2::ManageConnection<Connection = cell::RefCell<T>, Error = error::Error>,
>:
GetCompressor<'static>
+ GetConnection<T, M>
+ QueryExecutor<T, M>
+ PrepareExecutor<T, M>
+ ExecExecutor<T, M>
+ BatchExecutor<T, M>
{
}