pub struct ConsistentHash<K> { /* private fields */ }Expand description
Stable ring selection over explicit member-token evidence.
Each eligible member contributes a positive fixed number of deterministic virtual points. A key selects the first clockwise point, wrapping at the ring end. Unknown members are ineligible; evidence rejection is atomic. Token and key hashes are application/System facts supplied through concrete functions and observations. Tokens are policy data, never actor identities or freshness evidence. Ring mixing, clockwise tie order, and replica count are deliberate Bombay policy; no external hash-routing crate is used. Router owns recipient identity and order; this policy retains only the corresponding versioned token evidence.
Implementations§
Source§impl<K> ConsistentHash<K>
impl<K> ConsistentHash<K>
Trait Implementations§
Source§impl<K> Clone for ConsistentHash<K>
impl<K> Clone for ConsistentHash<K>
Source§impl<Route, K> RoutingStrategy<Route> for ConsistentHash<K>
impl<Route, K> RoutingStrategy<Route> for ConsistentHash<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 ConsistentHash<K>
impl<K> RefUnwindSafe for ConsistentHash<K>
impl<K> Send for ConsistentHash<K>
impl<K> Sync for ConsistentHash<K>
impl<K> Unpin for ConsistentHash<K>
impl<K> UnsafeUnpin for ConsistentHash<K>
impl<K> UnwindSafe for ConsistentHash<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