[][src]Struct iced_audio::Normal

pub struct Normal { /* fields omitted */ }

An f32 value that is gauranteed to be constrained to the range of

0.0 >= value >= 1.0

Example

use iced_audio::Normal;

let mut normal = Normal::new(-1.0);
assert_eq!(normal.value(), 0.0);

normal.set(3.0);
assert_eq!(normal.value(), 1.0);

normal.set(0.5);
assert_eq!(normal.value(), 0.5);

Methods

impl Normal[src]

pub fn new(value: f32) -> Self[src]

Creates a new Normal.

Arguments

  • value - the value to initialize the Normal with

if value < 0.0, then normal.value is set to 0.0

else if value > 1.0, then normal.value is set to 1.0

else normal.value is set to value

pub fn set(&mut self, value: f32)[src]

Set a value for the Normal.

Arguments

  • value - the value to set the Normal with

if value < 0.0, then normal.value is set to 0.0

else if value > 1.0, then normal.value is set to 1.0

else normal.value is set to value

pub fn value(&self) -> f32[src]

Returns the value of the Normal

Trait Implementations

impl Clone for Normal[src]

impl Copy for Normal[src]

impl Debug for Normal[src]

impl Default for Normal[src]

impl From<Normal> for f32[src]

impl From<f32> for Normal[src]

impl PartialEq<Normal> for Normal[src]

impl PartialOrd<Normal> for Normal[src]

impl StructuralPartialEq for Normal[src]

Auto Trait Implementations

impl RefUnwindSafe for Normal

impl Send for Normal

impl Sync for Normal

impl Unpin for Normal

impl UnwindSafe for Normal

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,