pub struct DeviceCollection { /* private fields */ }
Expand description
Struct wrapping an IMMDeviceCollection.
Implementations§
Source§impl DeviceCollection
impl DeviceCollection
Sourcepub fn new(direction: &Direction) -> Result<DeviceCollection, WasapiError>
pub fn new(direction: &Direction) -> Result<DeviceCollection, WasapiError>
Get an [IMMDeviceCollection] of all active playback or capture devices
Sourcepub fn get_nbr_devices(&self) -> Result<u32, WasapiError>
pub fn get_nbr_devices(&self) -> Result<u32, WasapiError>
Get the number of devices in an [IMMDeviceCollection]
Sourcepub fn get_device_at_index(&self, idx: u32) -> Result<Device, WasapiError>
pub fn get_device_at_index(&self, idx: u32) -> Result<Device, WasapiError>
Get a device from an [IMMDeviceCollection] using index
Sourcepub fn get_device_with_name(&self, name: &str) -> Result<Device, WasapiError>
pub fn get_device_with_name(&self, name: &str) -> Result<Device, WasapiError>
Get a device from an [IMMDeviceCollection] using name
Sourcepub fn get_direction(&self) -> Direction
pub fn get_direction(&self) -> Direction
Get the direction for this DeviceCollection
Trait Implementations§
Source§impl<'a> IntoIterator for &'a DeviceCollection
Implement iterator for DeviceCollection
impl<'a> IntoIterator for &'a DeviceCollection
Implement iterator for DeviceCollection
Auto Trait Implementations§
impl Freeze for DeviceCollection
impl RefUnwindSafe for DeviceCollection
impl !Send for DeviceCollection
impl !Sync for DeviceCollection
impl Unpin for DeviceCollection
impl UnwindSafe for DeviceCollection
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