Skip to main content

Percent

Trait Percent 

Source
pub trait Percent {
    // Required method
    fn percent(self) -> f64;
}
Expand description

A number that can be a percentage. pct(80) and pct(80.0) are the same.

Required Methods§

Source

fn percent(self) -> f64

100 is the whole reference size.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Percent for f64

Source§

fn percent(self) -> f64

Source§

impl Percent for i32

Source§

fn percent(self) -> f64

Implementors§