Struct scylla::routing::Sharder [−][src]
pub struct Sharder {
pub nr_shards: ShardCount,
pub msb_ignore: u8,
}
Fields
nr_shards: ShardCount
msb_ignore: u8
Implementations
If we connect to Scylla using Scylla’s shard aware port, then Scylla assigns a shard to the connection based on the source port. This calculates the assigned shard.
Randomly choose a source port p
such that shard == shard_of_source_port(p)
.
Returns iterator over source ports p
such that shard == shard_of_source_port(p)
.
Starts at a random port and goes forward by nr_shards
. After reaching maximum wraps back around.
Stops once all possibile ports have been returned
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Sharder
impl UnwindSafe for Sharder
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more