pub struct AudioPortFormat {
pub sample_format: Option<SampleFormat>,
pub sample_rate: Option<u32>,
pub channels: Option<u32>,
}Expand description
Audio port format specification.
Fields§
§sample_format: Option<SampleFormat>Sample format (or None for any).
sample_rate: Option<u32>Sample rate in Hz (or None for any).
channels: Option<u32>Number of channels (or None for any).
Implementations§
Source§impl AudioPortFormat
impl AudioPortFormat
Sourcepub fn new(sample_format: SampleFormat) -> Self
pub fn new(sample_format: SampleFormat) -> Self
Create a new audio format with specific sample format.
Sourcepub fn with_sample_rate(self, rate: u32) -> Self
pub fn with_sample_rate(self, rate: u32) -> Self
Set the sample rate.
Sourcepub fn with_channels(self, channels: u32) -> Self
pub fn with_channels(self, channels: u32) -> Self
Set the number of channels.
Sourcepub fn is_compatible(&self, other: &Self) -> bool
pub fn is_compatible(&self, other: &Self) -> bool
Check if compatible with another audio format.
Trait Implementations§
Source§impl Clone for AudioPortFormat
impl Clone for AudioPortFormat
Source§fn clone(&self) -> AudioPortFormat
fn clone(&self) -> AudioPortFormat
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 AudioPortFormat
impl Debug for AudioPortFormat
Source§impl Default for AudioPortFormat
impl Default for AudioPortFormat
Source§impl Display for AudioPortFormat
impl Display for AudioPortFormat
Source§impl PartialEq for AudioPortFormat
impl PartialEq for AudioPortFormat
Source§fn eq(&self, other: &AudioPortFormat) -> bool
fn eq(&self, other: &AudioPortFormat) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AudioPortFormat
Auto Trait Implementations§
impl Freeze for AudioPortFormat
impl RefUnwindSafe for AudioPortFormat
impl Send for AudioPortFormat
impl Sync for AudioPortFormat
impl Unpin for AudioPortFormat
impl UnsafeUnpin for AudioPortFormat
impl UnwindSafe for AudioPortFormat
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more