ShadowRouter

Struct ShadowRouter 

Source
pub struct ShadowRouter<Conn: Debug + Hash + Eq + Clone + Copy, Remote: Debug + Hash + Eq + Clone + Copy> { /* private fields */ }

Implementations§

Source§

impl<Conn: Debug + Hash + Eq + Clone + Copy, Remote: Debug + Hash + Eq + Clone + Copy> ShadowRouter<Conn, Remote>

Source

pub fn new(node_id: NodeId, cached: Arc<dyn ShadowRouterHistory>) -> Self

Source

pub fn apply_delta(&mut self, delta: ShadowRouterDelta<Conn, Remote>)

Trait Implementations§

Source§

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>

Find the next node for the given destination node
Source§

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>

Determine the next action for the given key
Source§

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>

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>

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>

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>
where Remote: Send, Conn: Send,

§

impl<Conn, Remote> Sync for ShadowRouter<Conn, Remote>
where Remote: Sync, Conn: Sync,

§

impl<Conn, Remote> Unpin for ShadowRouter<Conn, Remote>
where Remote: Unpin, Conn: Unpin,

§

impl<Conn, Remote> !UnwindSafe for ShadowRouter<Conn, Remote>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Any for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Source§

fn type_name(&self) -> &'static str

Source§

impl<T> AnySync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V