pub struct TokenRange { /* private fields */ }Expand description
Half-open token range [start, end) covering one slice of
the consistent-hashing ring.
Used by AAE exchanges to identify which partition is being
reconciled. The range is interpreted as wrap-around when
start >= end, matching the ring traversal semantics in
crate::cluster::pool.
§Examples
use dynomite::events::TokenRange;
use dynomite::hashkit::DynToken;
let r = TokenRange::new(DynToken::from_u32(0), DynToken::from_u32(1024));
assert_eq!(r.start(), &DynToken::from_u32(0));
assert_eq!(r.end(), &DynToken::from_u32(1024));Implementations§
Trait Implementations§
Source§impl Clone for TokenRange
impl Clone for TokenRange
Source§fn clone(&self) -> TokenRange
fn clone(&self) -> TokenRange
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TokenRange
impl Debug for TokenRange
Source§impl Hash for TokenRange
impl Hash for TokenRange
Source§impl PartialEq for TokenRange
impl PartialEq for TokenRange
Source§fn eq(&self, other: &TokenRange) -> bool
fn eq(&self, other: &TokenRange) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for TokenRange
impl StructuralPartialEq for TokenRange
Auto Trait Implementations§
impl Freeze for TokenRange
impl RefUnwindSafe for TokenRange
impl Send for TokenRange
impl Sync for TokenRange
impl Unpin for TokenRange
impl UnsafeUnpin for TokenRange
impl UnwindSafe for TokenRange
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.