[][src]Trait sp_runtime::SaturatedConversion

pub trait SaturatedConversion {
    fn saturated_from<T>(t: T) -> Self
    where
        Self: UniqueSaturatedFrom<T>
, { ... }
fn saturated_into<T>(self) -> T
    where
        Self: UniqueSaturatedInto<T>
, { ... } }

Re-export top-level arithmetic stuff. Convenience type to work around the highly unergonomic syntax needed to invoke the functions of overloaded generic traits, in this case SaturatedFrom and SaturatedInto.

Provided methods

fn saturated_from<T>(t: T) -> Self where
    Self: UniqueSaturatedFrom<T>, 

Convert from a value of T into an equivalent instance of Self.

This just uses UniqueSaturatedFrom internally but with this variant you can provide the destination type using turbofish syntax in case Rust happens not to assume the correct type.

fn saturated_into<T>(self) -> T where
    Self: UniqueSaturatedInto<T>, 

Consume self to return an equivalent value of T.

This just uses UniqueSaturatedInto internally but with this variant you can provide the destination type using turbofish syntax in case Rust happens not to assume the correct type.

Loading content...

Implementors

impl<T> SaturatedConversion for T[src]

Loading content...