pub enum OpenCCError {
Io(Error),
Json(Error),
Fst(Error),
BincodeDecode(DecodeError),
BincodeEncode(EncodeError),
InvalidConfig(String),
ConfigNotFound(String),
FileNotFound(String),
UnsupportedDictType(String),
DictCompileError(Error),
}Expand description
ferrous-opencc 库的主错误类型。
Variants§
Io(Error)
I/O 错误
Json(Error)
解析 JSON 配置文件时的错误
Fst(Error)
与 FST 库相关的错误
BincodeDecode(DecodeError)
Bincode 反序列化过程中的错误
BincodeEncode(EncodeError)
Bincode 序列化过程中发生的错误
InvalidConfig(String)
无效的配置格式
ConfigNotFound(String)
在嵌入式资源中找不到指定的配置或词典
FileNotFound(String)
找不到所需的文件
UnsupportedDictType(String)
不支持的词典类型
DictCompileError(Error)
从文本文件编译词典时发生错误
Trait Implementations§
Source§impl Debug for OpenCCError
impl Debug for OpenCCError
Source§impl Display for OpenCCError
impl Display for OpenCCError
Source§impl Error for OpenCCError
impl Error for OpenCCError
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<DecodeError> for OpenCCError
impl From<DecodeError> for OpenCCError
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
Source§impl From<EncodeError> for OpenCCError
impl From<EncodeError> for OpenCCError
Source§fn from(source: EncodeError) -> Self
fn from(source: EncodeError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for OpenCCError
impl From<Error> for OpenCCError
Source§impl From<Error> for OpenCCError
impl From<Error> for OpenCCError
Source§impl From<Error> for OpenCCError
impl From<Error> for OpenCCError
Auto Trait Implementations§
impl Freeze for OpenCCError
impl !RefUnwindSafe for OpenCCError
impl Send for OpenCCError
impl Sync for OpenCCError
impl Unpin for OpenCCError
impl !UnwindSafe for OpenCCError
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