[][src]Struct scylla::routing::ShardInfo

pub struct ShardInfo { /* fields omitted */ }

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]

type Error = Error

The type returned in the event of a conversion error.

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]