pub enum AppError {
FfmpegNotFound,
FfmpegFailed {
code: Option<i32>,
stderr: String,
},
Io(Error),
Whisper(WhisperError),
Audio(String),
InvalidPath(PathBuf),
Other(String),
}Expand description
流水线各阶段可能产生的错误。
Variants§
FfmpegNotFound
系统 PATH 中未找到 ffmpeg,且未通过 CLI --ffmpeg 指定有效路径。
FfmpegFailed
FFmpeg 子进程以非零状态退出。
Io(Error)
文件读写等标准库 IO 错误。
Whisper(WhisperError)
whisper-rs / whisper.cpp 推理或模型加载失败。
Audio(String)
WAV 格式不符合要求,或样本读取失败。
InvalidPath(PathBuf)
输入视频、模型路径等不存在或不可作为 UTF-8 路径使用。
Other(String)
其它未分类错误(预留扩展)。
Trait Implementations§
Source§impl Error for AppError
impl Error for AppError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<WhisperError> for AppError
impl From<WhisperError> for AppError
Source§fn from(source: WhisperError) -> Self
fn from(source: WhisperError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AppError
impl !RefUnwindSafe for AppError
impl Send for AppError
impl Sync for AppError
impl Unpin for AppError
impl UnsafeUnpin for AppError
impl !UnwindSafe for AppError
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