#[derive(Debug, PartialEq, thiserror::Error)]
pub enum KeyspaceError {
#[error("Not enough nodes for a given replication factor: {0}")]
NotEnoughNodes(usize),
#[error("Incomplete replica set")]
IncompleteReplicaSet,
#[error("Non-empty keyspace")]
NonEmptyKeyspace,
#[error("Out of indexes in nodes to index mapping")]
OutOfIndexes,
#[error("Shards not initialized")]
ShardsNotInitialized,
#[error("Number of shards in new and old keyspace do not match")]
ShardCountMismatch,
}
pub type KeyspaceResult<T> = Result<T, KeyspaceError>;