pub struct StableShardRouter { /* private fields */ }Expand description
Router over a fixed virtual space with a tunable active prefix (Tier 2).
Implementations§
Source§impl StableShardRouter
impl StableShardRouter
Sourcepub fn active_count(&self) -> u32
pub fn active_count(&self) -> u32
Number of virtual shards currently accepting keyed traffic.
Sourcepub fn shard_for(&self, key: &[u8]) -> Option<ShardId>
pub fn shard_for(&self, key: &[u8]) -> Option<ShardId>
Virtual shard for key, or None when the key lands outside the active prefix.
Sourcepub fn activate_shards(
&mut self,
new_active: u32,
) -> Result<StableShardActivationPlan, StableShardActivationError>
pub fn activate_shards( &mut self, new_active: u32, ) -> Result<StableShardActivationPlan, StableShardActivationError>
Grow the active prefix without remapping keys already in [0, from).
§Errors
Same rules as plan_stable_shard_activation.
Trait Implementations§
Source§impl Clone for StableShardRouter
impl Clone for StableShardRouter
Source§fn clone(&self) -> StableShardRouter
fn clone(&self) -> StableShardRouter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StableShardRouter
Source§impl Debug for StableShardRouter
impl Debug for StableShardRouter
impl Eq for StableShardRouter
Source§impl PartialEq for StableShardRouter
impl PartialEq for StableShardRouter
impl StructuralPartialEq for StableShardRouter
Auto Trait Implementations§
impl Freeze for StableShardRouter
impl RefUnwindSafe for StableShardRouter
impl Send for StableShardRouter
impl Sync for StableShardRouter
impl Unpin for StableShardRouter
impl UnsafeUnpin for StableShardRouter
impl UnwindSafe for StableShardRouter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more