[−][src]Struct iced_audio::Normal
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 theNormal
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 theNormal
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]
fn partial_cmp(&self, other: &Normal) -> Option<Ordering>
[src]
fn lt(&self, other: &Normal) -> bool
[src]
fn le(&self, other: &Normal) -> bool
[src]
fn gt(&self, other: &Normal) -> bool
[src]
fn ge(&self, other: &Normal) -> bool
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,