Skip to main content

FromPercent

Trait FromPercent 

Source
pub trait FromPercent {
    // Required method
    fn from_percent<Input: Into<f64> + Copy>(percent: Input) -> Self;
}
Expand description

Trait to create constant percent values from plain numbers

Required Methods§

Source

fn from_percent<Input: Into<f64> + Copy>(percent: Input) -> Self

Converts into an Into<f64> into Self

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 FromPercent for Option<f32>

Source§

fn from_percent<Input: Into<f64> + Copy>(percent: Input) -> Self

Source§

impl FromPercent for f32

Source§

fn from_percent<Input: Into<f64> + Copy>(percent: Input) -> Self

Implementors§