Skip to main content

NumRemap

Trait NumRemap 

Source
pub trait NumRemap<N> {
    // Required methods
    fn remap<U: FloatCore + NumLerp<U> + From<N>>(
        self,
        from: Range<U>,
        to: Range<U>,
    ) -> U;
    fn try_remap<U: FloatCore + NumLerp<U> + TryFrom<N>>(
        self,
        from: Range<U>,
        to: Range<U>,
    ) -> Result<U, U::Error>;

    // Provided methods
    fn remap01<U: FloatCore + NumLerp<U> + From<N>>(self) -> U
       where N: Bounded,
             Self: Sized { ... }
    fn try_remap01<U: FloatCore + NumLerp<U> + TryFrom<N>>(
        self,
    ) -> Result<U, U::Error>
       where N: Bounded,
             Self: Sized { ... }
}

Required Methods§

Source

fn remap<U: FloatCore + NumLerp<U> + From<N>>( self, from: Range<U>, to: Range<U>, ) -> U

Source

fn try_remap<U: FloatCore + NumLerp<U> + TryFrom<N>>( self, from: Range<U>, to: Range<U>, ) -> Result<U, U::Error>

Provided Methods§

Source

fn remap01<U: FloatCore + NumLerp<U> + From<N>>(self) -> U
where N: Bounded, Self: Sized,

Source

fn try_remap01<U: FloatCore + NumLerp<U> + TryFrom<N>>( self, ) -> Result<U, U::Error>
where N: Bounded, Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<N: Num + NumPercent<N>> NumRemap<N> for N