[−][src]Struct scylla::routing::ShardInfo
Implementations
impl ShardInfo
[src]
pub fn new(shard: u16, nr_shards: u16, msb_ignore: u8) -> Self
[src]
pub fn shard_of(&self, token: Token) -> Shard
[src]
pub fn shard_of_source_port(&self, source_port: u16) -> Shard
[src]
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.
pub fn draw_source_port_for_token(&self, t: Token) -> u16
[src]
Randomly choose a source port p
such that shard_of(t) == shard_of_source_port(p)
.
Trait Implementations
impl Clone for ShardInfo
[src]
impl Debug for ShardInfo
[src]
impl Eq for ShardInfo
[src]
impl PartialEq<ShardInfo> for ShardInfo
[src]
impl StructuralEq for ShardInfo
[src]
impl StructuralPartialEq for ShardInfo
[src]
impl<'a> TryFrom<&'a HashMap<String, Vec<String>, RandomState>> for ShardInfo
[src]
Auto Trait Implementations
impl RefUnwindSafe for ShardInfo
impl Send for ShardInfo
impl Sync for ShardInfo
impl Unpin for ShardInfo
impl UnwindSafe for ShardInfo
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,