pub struct AudioFormat {
pub sample_rate: u32,
pub channels: u16,
}Expand description
PCM stream format, checked once at the intake boundary.
Fields§
§sample_rate: u32Frames per second, in MIN_SAMPLE_RATE..=MAX_SAMPLE_RATE.
channels: u16Interleaved channel count, in 1..=MAX_CHANNELS.
Implementations§
Source§impl AudioFormat
impl AudioFormat
Sourcepub fn validate(self) -> Result<Self, FormatError>
pub fn validate(self) -> Result<Self, FormatError>
Check the rate and channel bounds; the hot path trusts the result.
Trait Implementations§
Source§impl Clone for AudioFormat
impl Clone for AudioFormat
Source§fn clone(&self) -> AudioFormat
fn clone(&self) -> AudioFormat
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AudioFormat
impl Debug for AudioFormat
Source§impl PartialEq for AudioFormat
impl PartialEq for AudioFormat
Source§fn eq(&self, other: &AudioFormat) -> bool
fn eq(&self, other: &AudioFormat) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for AudioFormat
impl Eq for AudioFormat
impl StructuralPartialEq for AudioFormat
Auto Trait Implementations§
impl Freeze for AudioFormat
impl RefUnwindSafe for AudioFormat
impl Send for AudioFormat
impl Sync for AudioFormat
impl Unpin for AudioFormat
impl UnsafeUnpin for AudioFormat
impl UnwindSafe for AudioFormat
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.