Add BackendSpecificError. Add new DevicesError.

See the documentation for both new errors for details.

The new `DevicesError` has been added to allow for returning errors when
enumerating devices. This has allowed to remove multiple potential
`panic!`s in each of the alsa, coreaudio and wasapi backends.
This commit is contained in:
mitchmindtree 2019-06-20 22:37:36 +02:00
parent cf84ab906f
commit 42fc702f53
8 changed files with 140 additions and 63 deletions

View file

@ -4,6 +4,7 @@ use std::marker::PhantomData;
use BuildStreamError;
use DefaultFormatError;
use DevicesError;
use Format;
use SupportedFormatsError;
use StreamData;
@ -56,6 +57,12 @@ pub struct StreamId;
#[derive(Default)]
pub struct Devices;
impl Devices {
pub fn new() -> Result<Self, DevicesError> {
Ok(Devices)
}
}
impl Iterator for Devices {
type Item = Device;