Skip to content

Commit

Permalink
Merge pull request #774 from wprzytula/codewide-unpub
Browse files Browse the repository at this point in the history
codewide: Decrease excessive visibility from `pub` - breaking changes
  • Loading branch information
wprzytula authored Aug 18, 2023
2 parents b06913d + b473908 commit 932c6b4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions scylla/src/routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -33,15 +33,15 @@ 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,
msb_ignore,
}
}

pub fn get_sharder(&self) -> Sharder {
pub(crate) fn get_sharder(&self) -> Sharder {
Sharder::new(self.nr_shards, self.msb_ignore)
}
}
Expand Down
2 changes: 1 addition & 1 deletion scylla/src/transport/locator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = (Token, Arc<Node>)>,
precompute_replica_sets_for: impl Iterator<Item = &'a Strategy>,
) -> Self {
Expand Down
4 changes: 2 additions & 2 deletions scylla/src/transport/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ impl<RowT: FromRow> Iterator for TypedRowIter<RowT> {
}
}

pub enum RunQueryResult<ResT> {
pub(crate) enum RunQueryResult<ResT> {
IgnoredWriteError,
Completed(ResT),
}
Expand Down Expand Up @@ -2018,7 +2018,7 @@ pub(crate) async fn resolve_hostname(hostname: &str) -> Result<SocketAddr, io::E
// When using run_query make sure that the ResT type is NOT able
// to contain any errors.
// See https://github.com/scylladb/scylla-rust-driver/issues/501
pub trait AllowedRunQueryResTType {}
pub(crate) trait AllowedRunQueryResTType {}

impl AllowedRunQueryResTType for Uuid {}
impl AllowedRunQueryResTType for QueryResult {}
Expand Down
2 changes: 1 addition & 1 deletion scylla/src/transport/speculative_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fn can_be_ignored<ResT>(result: &Result<ResT, QueryError>) -> bool {

const EMPTY_PLAN_ERROR: QueryError = QueryError::ProtocolError("Empty query plan - driver bug!");

pub async fn execute<QueryFut, ResT>(
pub(crate) async fn execute<QueryFut, ResT>(
policy: &dyn SpeculativeExecutionPolicy,
context: &Context,
query_runner_generator: impl Fn(bool) -> QueryFut,
Expand Down
8 changes: 4 additions & 4 deletions scylla/src/transport/topology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ pub(crate) struct MetadataReader {
}

/// Describes all metadata retrieved from the cluster
pub struct Metadata {
pub peers: Vec<Peer>,
pub keyspaces: HashMap<String, Keyspace>,
pub(crate) struct Metadata {
pub(crate) peers: Vec<Peer>,
pub(crate) keyspaces: HashMap<String, Keyspace>,
}

#[non_exhaustive] // <- so that we can add more fields in a backwards-compatible way
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 932c6b4

Please sign in to comment.