Skip to main content

NumsRemap

Trait NumsRemap 

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

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

Required Methods§

Source

fn remap<U: FloatCore + NumRemap<U> + From<N>>( self, from: Range<U>, to: Range<U>, ) -> [U; L]

Source

fn try_remap<U: FloatCore + NumRemap<U> + TryFrom<N>>( self, from: Range<U>, to: Range<U>, ) -> Result<[U; L], U::Error>

Provided Methods§

Source

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

Source

fn try_remap01<U: FloatCore + NumLerp<U> + TryFrom<N>>( self, ) -> Result<[U; L], 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".

Implementations on Foreign Types§

Source§

impl<N: Num, const L: usize> NumsRemap<N, L> for [N; L]

Source§

fn remap<U: FloatCore + NumRemap<U> + From<N>>( self, from: Range<U>, to: Range<U>, ) -> [U; L]

Source§

fn try_remap<U: FloatCore + NumRemap<U> + TryFrom<N>>( self, from: Range<U>, to: Range<U>, ) -> Result<[U; L], U::Error>

Implementors§