Trait sp_runtime::traits::SaturatedConversion[][src]

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

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

pub fn saturated_from<T>(t: T) -> Self where
    Self: UniqueSaturatedFrom<T>, 
[src]

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.

pub fn saturated_into<T>(self) -> T where
    Self: UniqueSaturatedInto<T>, 
[src]

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...