pub enum Error {
Ffi(String),
NullHandle(String),
Json(Error),
Nul(NulError),
NonUtf8Path(PathBuf),
Other(String),
}Expand description
audio-cpp 高层 API 的错误类型。
Variants§
Ffi(String)
C ABI 调用失败(返回非 0),msg 为 shim 的 audiocpp_last_error()。
NullHandle(String)
C++ 侧返回空句柄(如加载模型 / 创建会话失败),msg 为错误信息。
Json(Error)
JSON 解析 / 序列化错误。
Nul(NulError)
字符串或路径中含 NUL 字节,无法转为 C 字符串。
NonUtf8Path(PathBuf)
路径含非法 UTF-8(capi.h 约定所有字符串均为 UTF-8)。
Other(String)
其他运行时错误(如示例中用户自选解码库的失败信息)。
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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