Skip to main content

PercentageVariance

Trait PercentageVariance 

Source
pub trait PercentageVariance {
    // Required methods
    fn delta(&self, percentage: i32) -> Self;
    fn jitter_percentage(&self, percentage: f64) -> Self;
}
Expand description

Percentage amount value variator(s).

Required Methods§

Source

fn delta(&self, percentage: i32) -> Self

👎Deprecated since 0.3.11:

Use jitter_percentage instead.

Source

fn jitter_percentage(&self, percentage: f64) -> Self

Take a number and alter it by up to (or less, of course) ±X%.

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 PercentageVariance for f32

Source§

fn delta(&self, percentage: i32) -> Self

👎Deprecated since 0.3.11:

Use jitter_percentage instead.

Source§

fn jitter_percentage(&self, percentage: f64) -> Self

Source§

impl PercentageVariance for f64

Source§

fn delta(&self, percentage: i32) -> Self

👎Deprecated since 0.3.11:

Use jitter_percentage instead.

Source§

fn jitter_percentage(&self, percentage: f64) -> Self

Implementors§