[−][src]Struct hash_rings::carp::Node
A node with an associated weight.
The distribution of points to nodes is proportional to the weights of the nodes. For example, a node with a weight of 3 will receive approximately three times more points than a node with a weight of 1.
Methods
impl<'a, T> Node<'a, T>
[src]
pub fn new(id: &'a T, weight: f64) -> Self
[src]
Constructs a new node with a particular weight associated with it.
Examples
use hash_rings::carp::{Node, Ring}; let node = Node::new(&"node-1", 1f64);
Auto Trait Implementations
impl<'a, T> Send for Node<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Sync for Node<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for Node<'a, T>
impl<'a, T> UnwindSafe for Node<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> RefUnwindSafe for Node<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,