pub struct ShadowRouter<Conn: Debug + Hash + Eq + Clone + Copy, Remote: Debug + Hash + Eq + Clone + Copy> { /* private fields */ }Implementations§
Trait Implementations§
Source§impl<Conn: Debug + Hash + Eq + Clone + Copy, Remote: Debug + Hash + Eq + Clone + Copy> RouterTable<Remote> for ShadowRouter<Conn, Remote>
impl<Conn: Debug + Hash + Eq + Clone + Copy, Remote: Debug + Hash + Eq + Clone + Copy> RouterTable<Remote> for ShadowRouter<Conn, Remote>
Source§fn next(&self, dest: NodeId) -> Option<Remote>
fn next(&self, dest: NodeId) -> Option<Remote>
Find the next node for the given destination node
Source§fn closest_for(&self, key: NodeId) -> Option<Remote>
fn closest_for(&self, key: NodeId) -> Option<Remote>
Find the closest node for the given key
Source§fn path_to_key(&self, key: NodeId) -> RouteAction<Remote>
fn path_to_key(&self, key: NodeId) -> RouteAction<Remote>
Determine the next action for the given key
Source§fn path_to_node(&self, dest: NodeId) -> RouteAction<Remote>
fn path_to_node(&self, dest: NodeId) -> RouteAction<Remote>
Determine the next action for the given destination node
Source§fn path_to_service(&self, service_id: u8) -> RouteAction<Remote>
fn path_to_service(&self, service_id: u8) -> RouteAction<Remote>
Determine the next action for the given service
Source§fn path_to_services(
&self,
service_id: u8,
seq: u16,
level: ServiceBroadcastLevel,
source: Option<NodeId>,
relay_from: Option<NodeId>,
) -> RouteAction<Remote>
fn path_to_services( &self, service_id: u8, seq: u16, level: ServiceBroadcastLevel, source: Option<NodeId>, relay_from: Option<NodeId>, ) -> RouteAction<Remote>
Determine the next action if we need broadcast to all node running a service.
If relay_from is set, it should not sending back for avoiding loop
Source§fn derive_action(
&self,
route: &RouteRule,
source: Option<NodeId>,
relay_from: Option<NodeId>,
) -> RouteAction<Remote>
fn derive_action( &self, route: &RouteRule, source: Option<NodeId>, relay_from: Option<NodeId>, ) -> RouteAction<Remote>
Determine next action for incoming messages
given the route rule and service id
Auto Trait Implementations§
impl<Conn, Remote> Freeze for ShadowRouter<Conn, Remote>where
Remote: Freeze,
impl<Conn, Remote> !RefUnwindSafe for ShadowRouter<Conn, Remote>
impl<Conn, Remote> Send for ShadowRouter<Conn, Remote>
impl<Conn, Remote> Sync for ShadowRouter<Conn, Remote>
impl<Conn, Remote> Unpin for ShadowRouter<Conn, Remote>
impl<Conn, Remote> !UnwindSafe for ShadowRouter<Conn, Remote>
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