pub struct RendezvousHash<K> { /* private fields */ }Expand description
Highest-random-weight selection over explicit stable member tokens.
The deterministic score mixes the route-key hash with each eligible member
token and selects the greatest score, breaking ties by membership order.
Evidence and identity laws are the same as ConsistentHash. This is a
reviewed local algorithm so external crates cannot silently own Bombay’s
membership or hash policy.
Router owns recipient identity and order; this policy retains only the
corresponding versioned token evidence.
Implementations§
Trait Implementations§
Source§impl<K> Clone for RendezvousHash<K>
impl<K> Clone for RendezvousHash<K>
Source§impl<Route, K> RoutingStrategy<Route> for RendezvousHash<K>
impl<Route, K> RoutingStrategy<Route> for RendezvousHash<K>
Source§type Observation = MemberTokenObservation<Route>
type Observation = MemberTokenObservation<Route>
Closed observation type accepted by this policy.
Source§type Error = MemberEvidenceError
type Error = MemberEvidenceError
Concrete observation rejection reason.
Source§fn select(
&mut self,
members: &[Route],
message: &<Route::Protocol as Protocol>::Msg,
) -> Option<usize>
fn select( &mut self, members: &[Route], message: &<Route::Protocol as Protocol>::Msg, ) -> Option<usize>
Select at most one index from this exact typed membership snapshot. Read more
Source§fn observe(
&mut self,
members: &[Route],
observation: Self::Observation,
) -> Result<(), RoutingObservationRejection<Self::Observation, Self::Error>>
fn observe( &mut self, members: &[Route], observation: Self::Observation, ) -> Result<(), RoutingObservationRejection<Self::Observation, Self::Error>>
Fold one typed observation against the same membership snapshot. Read more
Auto Trait Implementations§
impl<K> Freeze for RendezvousHash<K>
impl<K> RefUnwindSafe for RendezvousHash<K>
impl<K> Send for RendezvousHash<K>
impl<K> Sync for RendezvousHash<K>
impl<K> Unpin for RendezvousHash<K>
impl<K> UnsafeUnpin for RendezvousHash<K>
impl<K> UnwindSafe for RendezvousHash<K>
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