#[non_exhaustive]pub struct Device {
pub id: String,
pub name: String,
pub default: bool,
pub host: String,
}Expand description
An audio input reported by devices.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringOpaque identifier: pass to Source::Microphone.
This is cpal’s host:device id, so it is stable across restarts and
unique even when two inputs share a name.
name: StringHuman-readable name, e.g. “MacBook Pro Microphone”.
default: boolWhether this is the system default input.
True for at most one device: the preferred host’s default. Another host’s default is that host’s, not the system’s.
host: StringThe host API this device is reached through, e.g. “PipeWire” or “ALSA”.
The same hardware is usually reachable through several, so a caller that offers a choice groups by this.
Implementations§
Trait Implementations§
impl Eq for Device
impl StructuralPartialEq for Device
Auto Trait Implementations§
impl Freeze for Device
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnsafeUnpin for Device
impl UnwindSafe for Device
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<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.