pub struct RoutingTable { /* private fields */ }Expand description
A routing table for shard lookups.
Implementations§
Source§impl RoutingTable
impl RoutingTable
Sourcepub fn upsert(&mut self, entry: RoutingEntry)
pub fn upsert(&mut self, entry: RoutingEntry)
Add or update an entry.
Sourcepub fn remove(&mut self, shard_id: &ShardId) -> Option<RoutingEntry>
pub fn remove(&mut self, shard_id: &ShardId) -> Option<RoutingEntry>
Remove an entry.
Sourcepub fn get(&self, shard_id: &ShardId) -> Option<&RoutingEntry>
pub fn get(&self, shard_id: &ShardId) -> Option<&RoutingEntry>
Get an entry.
Sourcepub fn find_shard(&self, key_hash: u64) -> Option<&RoutingEntry>
pub fn find_shard(&self, key_hash: u64) -> Option<&RoutingEntry>
Find the shard for a key hash.
Sourcepub fn all_entries(&self) -> impl Iterator<Item = &RoutingEntry>
pub fn all_entries(&self) -> impl Iterator<Item = &RoutingEntry>
Get all entries.
Sourcepub fn from_shards(shards: &[Shard]) -> Self
pub fn from_shards(shards: &[Shard]) -> Self
Build from a shard manager.
Trait Implementations§
Source§impl Clone for RoutingTable
impl Clone for RoutingTable
Source§fn clone(&self) -> RoutingTable
fn clone(&self) -> RoutingTable
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RoutingTable
impl Debug for RoutingTable
Auto Trait Implementations§
impl Freeze for RoutingTable
impl RefUnwindSafe for RoutingTable
impl Send for RoutingTable
impl Sync for RoutingTable
impl Unpin for RoutingTable
impl UnsafeUnpin for RoutingTable
impl UnwindSafe for RoutingTable
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