pub struct ConsistentHash<Stub, S = RandomState> { /* private fields */ }Expand description
A Stub that load-balances across backing stubs by round robin.
Implementations§
Source§impl<Stub> ConsistentHash<Stub, RandomState>
impl<Stub> ConsistentHash<Stub, RandomState>
Sourcepub fn new(stubs: Vec<Stub>) -> Result<Self, TryFromIntError>
pub fn new(stubs: Vec<Stub>) -> Result<Self, TryFromIntError>
Returns a new RoundRobin stub.
Returns an err if the length of stubs overflows a u64.
Source§impl<Stub, S> ConsistentHash<Stub, S>
impl<Stub, S> ConsistentHash<Stub, S>
Sourcepub fn with_hasher(stubs: Vec<Stub>, hasher: S) -> Result<Self, TryFromIntError>
pub fn with_hasher(stubs: Vec<Stub>, hasher: S) -> Result<Self, TryFromIntError>
Returns a new RoundRobin stub.
Returns an err if the length of stubs overflows a u64.
Trait Implementations§
Source§impl<Stub: Clone, S: Clone> Clone for ConsistentHash<Stub, S>
impl<Stub: Clone, S: Clone> Clone for ConsistentHash<Stub, S>
Source§fn clone(&self) -> ConsistentHash<Stub, S>
fn clone(&self) -> ConsistentHash<Stub, S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Stub, S> Stub for ConsistentHash<Stub, S>
impl<Stub, S> Stub for ConsistentHash<Stub, S>
Auto Trait Implementations§
impl<Stub, S> Freeze for ConsistentHash<Stub, S>where
S: Freeze,
impl<Stub, S> RefUnwindSafe for ConsistentHash<Stub, S>where
S: RefUnwindSafe,
Stub: RefUnwindSafe,
impl<Stub, S> Send for ConsistentHash<Stub, S>
impl<Stub, S> Sync for ConsistentHash<Stub, S>
impl<Stub, S> Unpin for ConsistentHash<Stub, S>
impl<Stub, S> UnwindSafe for ConsistentHash<Stub, S>where
S: UnwindSafe,
Stub: UnwindSafe,
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