[][src]Trait sp_arithmetic::Normalizable

pub trait Normalizable<T> {
    fn normalize(&self, targeted_sum: T) -> Result<Vec<T>, &'static str>;
}

A collection-like object that is made of values of type T and can normalize its individual values around a centric point.

Note that the order of items in the collection may affect the result.

Required methods

fn normalize(&self, targeted_sum: T) -> Result<Vec<T>, &'static str>

Normalize self around targeted_sum.

Only returns Ok if the new sum of results is guaranteed to be equal to targeted_sum. Else, returns an error explaining why it failed to do so.

Loading content...

Implementations on Foreign Types

impl Normalizable<u8> for Vec<u8>[src]

impl Normalizable<u16> for Vec<u16>[src]

impl Normalizable<u32> for Vec<u32>[src]

impl Normalizable<u64> for Vec<u64>[src]

impl Normalizable<u128> for Vec<u128>[src]

impl<P: PerThing> Normalizable<P> for Vec<P>[src]

Loading content...

Implementors

Loading content...