@@ -40,7 +40,7 @@ use super::topology::Strategy;
4040
4141/// Cluster manages up to date information and connections to database nodes.
4242/// All data can be accessed by cloning Arc<ClusterData> in the `data` field
43- pub struct Cluster {
43+ pub ( crate ) struct Cluster {
4444 // `ArcSwap<ClusterData>` is wrapped in `Arc` to support sharing cluster data
4545 // between `Cluster` and `ClusterWorker`
4646 data : Arc < ArcSwap < ClusterData > > ,
@@ -53,7 +53,7 @@ pub struct Cluster {
5353
5454/// Enables printing [Cluster] struct in a neat way, by skipping the rather useless
5555/// print of channels state and printing [ClusterData] neatly.
56- pub struct ClusterNeatDebug < ' a > ( pub & ' a Cluster ) ;
56+ pub ( crate ) struct ClusterNeatDebug < ' a > ( pub ( crate ) & ' a Cluster ) ;
5757impl < ' a > std:: fmt:: Debug for ClusterNeatDebug < ' a > {
5858 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
5959 let cluster = self . 0 ;
@@ -78,7 +78,7 @@ pub struct ClusterData {
7878
7979/// Enables printing [ClusterData] struct in a neat way, skipping the clutter involved by
8080/// [ClusterData::ring] being large and [Self::keyspaces] debug print being very verbose by default.
81- pub struct ClusterDataNeatDebug < ' a > ( pub & ' a Arc < ClusterData > ) ;
81+ pub ( crate ) struct ClusterDataNeatDebug < ' a > ( pub ( crate ) & ' a Arc < ClusterData > ) ;
8282impl < ' a > std:: fmt:: Debug for ClusterDataNeatDebug < ' a > {
8383 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
8484 let cluster_data = & self . 0 ;
@@ -137,7 +137,7 @@ struct UseKeyspaceRequest {
137137}
138138
139139impl Cluster {
140- pub async fn new (
140+ pub ( crate ) async fn new (
141141 initial_peers : Vec < ContactPoint > ,
142142 pool_config : PoolConfig ,
143143 keyspaces_to_fetch : Vec < String > ,
@@ -199,11 +199,11 @@ impl Cluster {
199199 Ok ( result)
200200 }
201201
202- pub fn get_data ( & self ) -> Arc < ClusterData > {
202+ pub ( crate ) fn get_data ( & self ) -> Arc < ClusterData > {
203203 self . data . load_full ( )
204204 }
205205
206- pub async fn refresh_metadata ( & self ) -> Result < ( ) , QueryError > {
206+ pub ( crate ) async fn refresh_metadata ( & self ) -> Result < ( ) , QueryError > {
207207 let ( response_sender, response_receiver) = tokio:: sync:: oneshot:: channel ( ) ;
208208
209209 self . refresh_channel
@@ -220,7 +220,7 @@ impl Cluster {
220220 // ClusterWorker always responds
221221 }
222222
223- pub async fn use_keyspace (
223+ pub ( crate ) async fn use_keyspace (
224224 & self ,
225225 keyspace_name : VerifiedKeyspaceName ,
226226 ) -> Result < ( ) , QueryError > {
@@ -239,7 +239,7 @@ impl Cluster {
239239 }
240240
241241 /// Returns nonempty list of working connections to all shards
242- pub async fn get_working_connections ( & self ) -> Result < Vec < Arc < Connection > > , QueryError > {
242+ pub ( crate ) async fn get_working_connections ( & self ) -> Result < Vec < Arc < Connection > > , QueryError > {
243243 let cluster_data: Arc < ClusterData > = self . get_data ( ) ;
244244 let peers = & cluster_data. known_peers ;
245245
@@ -479,7 +479,7 @@ impl ClusterData {
479479}
480480
481481impl ClusterWorker {
482- pub async fn work ( mut self ) {
482+ pub ( crate ) async fn work ( mut self ) {
483483 use tokio:: time:: Instant ;
484484
485485 let refresh_duration = Duration :: from_secs ( 60 ) ; // Refresh topology every 60 seconds
0 commit comments