pub struct DeviceEnumerator { /* private fields */ }Expand description
Struct wrapping an IMMDeviceEnumerator
Implementations§
Source§impl DeviceEnumerator
impl DeviceEnumerator
Sourcepub fn new() -> Result<DeviceEnumerator, WasapiError>
pub fn new() -> Result<DeviceEnumerator, WasapiError>
Create a new DeviceEnumerator
Sourcepub fn get_device_collection(
&self,
direction: &Direction,
) -> Result<DeviceCollection, WasapiError>
pub fn get_device_collection( &self, direction: &Direction, ) -> Result<DeviceCollection, WasapiError>
Get an [IMMDeviceCollection] of all active playback or capture devices
Sourcepub fn get_default_device(
&self,
direction: &Direction,
) -> Result<Device, WasapiError>
pub fn get_default_device( &self, direction: &Direction, ) -> Result<Device, WasapiError>
Get the default playback or capture device for the console role
Sourcepub fn get_default_device_for_role(
&self,
direction: &Direction,
role: &Role,
) -> Result<Device, WasapiError>
pub fn get_default_device_for_role( &self, direction: &Direction, role: &Role, ) -> Result<Device, WasapiError>
Get the default playback or capture device for a specific role
Sourcepub fn get_device(&self, device_id: &str) -> Result<Device, WasapiError>
pub fn get_device(&self, device_id: &str) -> Result<Device, WasapiError>
Get the device of a given Id. The Id can be obtained by calling Device::get_id()
Auto Trait Implementations§
impl Freeze for DeviceEnumerator
impl RefUnwindSafe for DeviceEnumerator
impl !Send for DeviceEnumerator
impl !Sync for DeviceEnumerator
impl Unpin for DeviceEnumerator
impl UnsafeUnpin for DeviceEnumerator
impl UnwindSafe for DeviceEnumerator
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