[][src]Struct hash_rings::carp::Node

pub struct Node<'a, T> { /* fields omitted */ }

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

impl<'a, T> Sync for Node<'a, T> where
    T: Sync

impl<'a, T> Unpin for Node<'a, T>

impl<'a, T> UnwindSafe for Node<'a, T> where
    T: RefUnwindSafe

impl<'a, T> RefUnwindSafe for Node<'a, T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]