Crate pmoflac

This commit is contained in:
2025-10-27 16:10:57 +01:00
parent c3a1b0e1f4
commit 0cfdc9f2c8
11 changed files with 1215 additions and 0 deletions

27
pmoflac/src/error.rs Normal file
View File

@@ -0,0 +1,27 @@
use std::io;
#[derive(thiserror::Error, Debug)]
pub enum FlacError {
#[error("I/O error: {0}")]
Io(#[from] io::Error),
#[error("FLAC decode error: {0}")]
Decode(String),
#[error("FLAC encode error: {0}")]
Encode(String),
#[error("libFLAC initialization failed: {0}")]
LibFlacInit(String),
#[error("libFLAC write callback failed: {0}")]
LibFlacWrite(String),
#[error("internal channel closed unexpectedly")]
ChannelClosed,
#[error("unsupported configuration: {0}")]
Unsupported(String),
#[error("{role} task failed: {details}")]
TaskJoin { role: &'static str, details: String },
}
impl From<claxon::Error> for FlacError {
fn from(err: claxon::Error) -> Self {
FlacError::Decode(err.to_string())
}
}