Skip to content

Commit fa09c1c

Browse files
authored
Merge pull request #773 from wprzytula/codewide-unpub-nonbreaking
codewide: Decrease excessive visibility from `pub` - nonbreaking changes
2 parents 8242efc + add6a97 commit fa09c1c

File tree

9 files changed

+118
-112
lines changed

9 files changed

+118
-112
lines changed

scylla/src/transport/caching_session.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ use std::hash::BuildHasher;
1919
/// to the `CachingSession::execute` family of methods.
2020
#[derive(Debug)]
2121
struct RawPreparedStatementData {
22-
pub id: Bytes,
23-
pub is_confirmed_lwt: bool,
24-
pub metadata: PreparedMetadata,
25-
pub partitioner_name: PartitionerName,
22+
id: Bytes,
23+
is_confirmed_lwt: bool,
24+
metadata: PreparedMetadata,
25+
partitioner_name: PartitionerName,
2626
}
2727

2828
/// Provides auto caching while executing queries

scylla/src/transport/cluster.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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);
5757
impl<'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>);
8282
impl<'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

139139
impl 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

481481
impl 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

Comments
 (0)