Struct wasapi::DeviceCollection
source · pub struct DeviceCollection { /* private fields */ }
Expand description
Struct wrapping an IMMDeviceCollection.
Implementations§
source§impl DeviceCollection
impl DeviceCollection
sourcepub fn new(direction: &Direction) -> Result<DeviceCollection, Box<dyn Error>>
pub fn new(direction: &Direction) -> Result<DeviceCollection, Box<dyn Error>>
Get an IMMDeviceCollection of all active playback or capture devices
sourcepub fn get_nbr_devices(&self) -> Result<u32, Box<dyn Error>>
pub fn get_nbr_devices(&self) -> Result<u32, Box<dyn Error>>
Get the number of devices in an IMMDeviceCollection
sourcepub fn get_device_at_index(&self, idx: u32) -> Result<Device, Box<dyn Error>>
pub fn get_device_at_index(&self, idx: u32) -> Result<Device, Box<dyn Error>>
Get a device from an IMMDeviceCollection using index
sourcepub fn get_device_with_name(&self, name: &str) -> Result<Device, Box<dyn Error>>
pub fn get_device_with_name(&self, name: &str) -> Result<Device, Box<dyn Error>>
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
impl<'a> IntoIterator for &'a DeviceCollection
Implement iterator for DeviceCollection
Auto Trait Implementations§
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