pub struct SampleRate(pub f64);Expand description
Sampling rate in samples per second.
Tuple Fields§
§0: f64Implementations§
Source§impl SampleRate
impl SampleRate
pub fn new(sample_rate: f64) -> Self
Sourcepub fn recip(&self) -> f64
pub fn recip(&self) -> f64
Returns the reciprocal of the sample rate (1.0 / sample_rate).
Note this is NOT cached, so this will always use a division operation.
pub fn as_f32(&self) -> f32
pub fn as_f64(&self) -> f64
pub fn as_u16(&self) -> u16
pub fn as_u32(&self) -> u32
pub fn as_usize(&self) -> usize
Trait Implementations§
Source§impl Clone for SampleRate
impl Clone for SampleRate
Source§fn clone(&self) -> SampleRate
fn clone(&self) -> SampleRate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SampleRate
impl Debug for SampleRate
Source§impl Default for SampleRate
impl Default for SampleRate
Source§impl Div<SampleRate> for f32
impl Div<SampleRate> for f32
Source§impl Div<SampleRate> for f64
impl Div<SampleRate> for f64
Source§impl From<f32> for SampleRate
impl From<f32> for SampleRate
Source§impl From<f64> for SampleRate
impl From<f64> for SampleRate
Source§impl From<u16> for SampleRate
impl From<u16> for SampleRate
Source§impl From<u32> for SampleRate
impl From<u32> for SampleRate
Source§impl Mul<SampleRate> for f32
impl Mul<SampleRate> for f32
Source§impl Mul<SampleRate> for f64
impl Mul<SampleRate> for f64
Source§impl PartialEq for SampleRate
impl PartialEq for SampleRate
Source§impl PartialOrd for SampleRate
impl PartialOrd for SampleRate
impl Copy for SampleRate
impl StructuralPartialEq for SampleRate
Auto Trait Implementations§
impl Freeze for SampleRate
impl RefUnwindSafe for SampleRate
impl Send for SampleRate
impl Sync for SampleRate
impl Unpin for SampleRate
impl UnwindSafe for SampleRate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more