Skip to main content

NumPercent

Trait NumPercent 

Source
pub trait NumPercent<N> {
    // Required methods
    fn percent_in<U: Num + From<N> + Clone>(self, range: Range<U>) -> U;
    fn try_percent_in<U: Num + TryFrom<N> + Clone>(
        self,
        range: Range<U>,
    ) -> Result<U, U::Error>;
}

Required Methods§

Source

fn percent_in<U: Num + From<N> + Clone>(self, range: Range<U>) -> U

§Safety
  • range.start != range.end
Source

fn try_percent_in<U: Num + TryFrom<N> + Clone>( self, range: Range<U>, ) -> Result<U, U::Error>

§Safety
  • range.start != range.end

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> for N