[][src]Struct rendezvous_hash::Capacity

pub struct Capacity(_);

The capacity of a weighted node.

"capacity" is a virtual value indicating the resource amount of a node. For example, if the capacity of a node is twice the other, the former may be selected by items twice as many times as the latter.

Methods

impl Capacity[src]

pub fn new(value: f64) -> Option<Self>[src]

Makes a new Capacity instance.

Note that capacity must be a normal and positive value. If a value which breaks the condition value.is_normal() && value.is_sign_positive() is passed, this function willl return None.

pub fn value(self) -> f64[src]

Returns the value of this instance.

Trait Implementations

impl Clone for Capacity[src]

impl PartialOrd<Capacity> for Capacity[src]

impl PartialEq<Capacity> for Capacity[src]

impl Copy for Capacity[src]

impl Debug for Capacity[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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