Skip to main content

volumecontrol_core/
lib.rs

1//! Core traits, errors, and shared types for the `volumecontrol` crate family.
2//!
3//! This crate defines the [`AudioDevice`] trait and the [`AudioError`] and
4//! [`DeviceInfo`] types that are shared across all platform backends.  It is
5//! not intended to be used directly; instead, depend on the
6//! [`volumecontrol`](https://crates.io/crates/volumecontrol) crate, which
7//! selects the right backend automatically.
8//!
9//! # Example
10//!
11//! ```
12//! use volumecontrol_core::AudioError;
13//!
14//! // `AudioError` is returned by all fallible operations across backends.
15//! let err = AudioError::DeviceNotFound;
16//! assert_eq!(err.to_string(), "audio device not found");
17//! ```
18
19#![deny(missing_docs)]
20
21mod error;
22mod structs;
23mod traits;
24
25pub use error::AudioError;
26pub use structs::DeviceInfo;
27pub use traits::AudioDevice;