diff --git a/scylla/src/routing.rs b/scylla/src/routing.rs index 5df667fefd..d6fff76466 100644 --- a/scylla/src/routing.rs +++ b/scylla/src/routing.rs @@ -13,10 +13,10 @@ pub type Shard = u32; pub type ShardCount = NonZeroU16; #[derive(PartialEq, Eq, Clone, Debug)] -pub struct ShardInfo { - pub shard: u16, - pub nr_shards: ShardCount, - pub msb_ignore: u8, +pub(crate) struct ShardInfo { + pub(crate) shard: u16, + pub(crate) nr_shards: ShardCount, + pub(crate) msb_ignore: u8, } #[derive(PartialEq, Eq, Clone, Debug)] @@ -33,7 +33,7 @@ impl std::str::FromStr for Token { } impl ShardInfo { - pub fn new(shard: u16, nr_shards: ShardCount, msb_ignore: u8) -> Self { + pub(crate) fn new(shard: u16, nr_shards: ShardCount, msb_ignore: u8) -> Self { ShardInfo { shard, nr_shards, @@ -41,7 +41,7 @@ impl ShardInfo { } } - pub fn get_sharder(&self) -> Sharder { + pub(crate) fn get_sharder(&self) -> Sharder { Sharder::new(self.nr_shards, self.msb_ignore) } } diff --git a/scylla/src/transport/locator/mod.rs b/scylla/src/transport/locator/mod.rs index dda4662600..db55b9fe69 100644 --- a/scylla/src/transport/locator/mod.rs +++ b/scylla/src/transport/locator/mod.rs @@ -38,7 +38,7 @@ impl ReplicaLocator { /// Creates a new `ReplicaLocator` in which the specified replication strategies /// (`precompute_replica_sets_for`) will have its token ranges precomputed. This function can /// potentially be CPU-intensive (if a ring & replication factors in given strategies are big). - pub fn new<'a>( + pub(crate) fn new<'a>( ring_iter: impl Iterator)>, precompute_replica_sets_for: impl Iterator, ) -> Self { diff --git a/scylla/src/transport/session.rs b/scylla/src/transport/session.rs index 9c85d23aa1..abda176b6e 100644 --- a/scylla/src/transport/session.rs +++ b/scylla/src/transport/session.rs @@ -423,7 +423,7 @@ impl Iterator for TypedRowIter { } } -pub enum RunQueryResult { +pub(crate) enum RunQueryResult { IgnoredWriteError, Completed(ResT), } @@ -2018,7 +2018,7 @@ pub(crate) async fn resolve_hostname(hostname: &str) -> Result(result: &Result) -> bool { const EMPTY_PLAN_ERROR: QueryError = QueryError::ProtocolError("Empty query plan - driver bug!"); -pub async fn execute( +pub(crate) async fn execute( policy: &dyn SpeculativeExecutionPolicy, context: &Context, query_runner_generator: impl Fn(bool) -> QueryFut, diff --git a/scylla/src/transport/topology.rs b/scylla/src/transport/topology.rs index 3379420c10..3d57b88529 100644 --- a/scylla/src/transport/topology.rs +++ b/scylla/src/transport/topology.rs @@ -49,9 +49,9 @@ pub(crate) struct MetadataReader { } /// Describes all metadata retrieved from the cluster -pub struct Metadata { - pub peers: Vec, - pub keyspaces: HashMap, +pub(crate) struct Metadata { + pub(crate) peers: Vec, + pub(crate) keyspaces: HashMap, } #[non_exhaustive] // <- so that we can add more fields in a backwards-compatible way @@ -349,7 +349,7 @@ impl Metadata { /// /// It can be used as a replacement for real metadata when initial /// metadata read fails. - pub fn new_dummy(initial_peers: &[UntranslatedEndpoint]) -> Self { + pub(crate) fn new_dummy(initial_peers: &[UntranslatedEndpoint]) -> Self { let peers = initial_peers .iter() .enumerate()