pub struct DeviceState {
pub sample_rate: f64,
pub running: bool,
}Expand description
The mutable runtime state of a device, distinct from the
immutable DeviceSpec the driver
declared.
A DeviceSpec says what a device is; a DeviceState says what
it is currently doing — the sample rate it is running at (which
the HAL can change via kAudioDevicePropertyNominalSampleRate)
and whether its IO is running. The property dispatcher reads it
for the handful of properties whose value is not fixed at
construction.
Fields§
§sample_rate: f64The sample rate the device is currently running at, in hertz. Starts at the spec’s nominal rate; the HAL may change it.
running: booltrue once the HAL has started the device’s IO (StartIO),
false before that and after StopIO.
Implementations§
Source§impl DeviceState
impl DeviceState
Sourcepub fn from_spec(spec: &DeviceSpec) -> Self
pub fn from_spec(spec: &DeviceSpec) -> Self
The initial runtime state for spec: its nominal sample
rate, IO not yet running.
Trait Implementations§
Source§impl Clone for DeviceState
impl Clone for DeviceState
Source§fn clone(&self) -> DeviceState
fn clone(&self) -> DeviceState
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 DeviceState
impl Debug for DeviceState
Source§impl PartialEq for DeviceState
impl PartialEq for DeviceState
Source§fn eq(&self, other: &DeviceState) -> bool
fn eq(&self, other: &DeviceState) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for DeviceState
impl StructuralPartialEq for DeviceState
Auto Trait Implementations§
impl Freeze for DeviceState
impl RefUnwindSafe for DeviceState
impl Send for DeviceState
impl Sync for DeviceState
impl Unpin for DeviceState
impl UnsafeUnpin for DeviceState
impl UnwindSafe for DeviceState
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