Merge pull request #308 from cormac-obrien/expose-playerror

Document PlayError and expose in public API
This commit is contained in:
est31 2020-08-05 03:50:02 +02:00 committed by GitHub
commit b376b91e9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -104,4 +104,4 @@ pub use crate::decoder::Decoder;
pub use crate::sink::Sink;
pub use crate::source::Source;
pub use crate::spatial_sink::SpatialSink;
pub use crate::stream::{OutputStream, OutputStreamHandle, StreamError};
pub use crate::stream::{OutputStream, OutputStreamHandle, PlayError, StreamError};

View file

@ -70,9 +70,12 @@ impl OutputStreamHandle {
}
}
/// An error occurred while attemping to play a sound.
#[derive(Debug)]
pub enum PlayError {
/// Attempting to decode the audio failed.
DecoderError(decoder::DecoderError),
/// The output device was lost.
NoDevice,
}