pub struct RoutingTable { /* private fields */ }Expand description
Maps physical partition node ids to listen addresses.
Implementations§
Source§impl RoutingTable
impl RoutingTable
Sourcepub fn insert(&mut self, node: NodeId, address: SocketAddr)
pub fn insert(&mut self, node: NodeId, address: SocketAddr)
Insert or replace the address for node.
Sourcepub fn lookup(&self, node: &NodeId) -> Result<SocketAddr, RouterError>
pub fn lookup(&self, node: &NodeId) -> Result<SocketAddr, RouterError>
Look up the address for node.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&NodeId, SocketAddr)> + '_
pub fn iter(&self) -> impl Iterator<Item = (&NodeId, SocketAddr)> + '_
Every (node, address) pair (order is hash-map iteration).
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
Source§impl Default for RoutingTable
impl Default for RoutingTable
Source§fn default() -> RoutingTable
fn default() -> RoutingTable
Returns the “default value” for a type. Read more
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