pub struct ConsistentHashingRingBuilder<T: RingHasherTrait, S: State = Empty> { /* private fields */ }Implementations§
Source§impl<T: RingHasherTrait, S: State> ConsistentHashingRingBuilder<T, S>
impl<T: RingHasherTrait, S: State> ConsistentHashingRingBuilder<T, S>
Sourcepub fn build(self) -> ConsistentHashingRing<T>where
S: IsComplete,
pub fn build(self) -> ConsistentHashingRing<T>where
S: IsComplete,
Finish building and return the requested object
Sourcepub fn hasher(self, value: T) -> ConsistentHashingRingBuilder<T, SetHasher<S>>where
S::Hasher: IsUnset,
pub fn hasher(self, value: T) -> ConsistentHashingRingBuilder<T, SetHasher<S>>where
S::Hasher: IsUnset,
Required.
The hashing function used to compute hash values for keys and nodes.
Sourcepub fn replication_factor(
self,
value: usize,
) -> ConsistentHashingRingBuilder<T, SetReplicationFactor<S>>where
S::ReplicationFactor: IsUnset,
pub fn replication_factor(
self,
value: usize,
) -> ConsistentHashingRingBuilder<T, SetReplicationFactor<S>>where
S::ReplicationFactor: IsUnset,
Required.
The number of physical nodes each key is replicated to for fault tolerance.
Sourcepub fn hash_to_vid(
self,
value: BTreeMap<u64, String>,
) -> ConsistentHashingRingBuilder<T, SetHashToVid<S>>where
S::HashToVid: IsUnset,
pub fn hash_to_vid(
self,
value: BTreeMap<u64, String>,
) -> ConsistentHashingRingBuilder<T, SetHashToVid<S>>where
S::HashToVid: IsUnset,
Required.
A mapping of hash values to virtual node IDs.
Sourcepub fn vid_to_pid(
self,
value: HashMap<String, String>,
) -> ConsistentHashingRingBuilder<T, SetVidToPid<S>>where
S::VidToPid: IsUnset,
pub fn vid_to_pid(
self,
value: HashMap<String, String>,
) -> ConsistentHashingRingBuilder<T, SetVidToPid<S>>where
S::VidToPid: IsUnset,
Required.
A mapping of virtual node IDs to physical node IDs.
Sourcepub fn physicals(
self,
value: HashMap<String, Rc<RefCell<PhysicalNode>>>,
) -> ConsistentHashingRingBuilder<T, SetPhysicals<S>>where
S::Physicals: IsUnset,
pub fn physicals(
self,
value: HashMap<String, Rc<RefCell<PhysicalNode>>>,
) -> ConsistentHashingRingBuilder<T, SetPhysicals<S>>where
S::Physicals: IsUnset,
Required.
A mapping of physical node IDs to their corresponding PhysicalNode instances.
Auto Trait Implementations§
impl<T, S> Freeze for ConsistentHashingRingBuilder<T, S>where
T: Freeze,
impl<T, S = Empty> !RefUnwindSafe for ConsistentHashingRingBuilder<T, S>
impl<T, S = Empty> !Send for ConsistentHashingRingBuilder<T, S>
impl<T, S = Empty> !Sync for ConsistentHashingRingBuilder<T, S>
impl<T, S> Unpin for ConsistentHashingRingBuilder<T, S>where
T: Unpin,
impl<T, S = Empty> !UnwindSafe for ConsistentHashingRingBuilder<T, S>
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