pub enum PreprocessError {
InvalidEscape(u8),
WordTooLong,
InvalidSymbol {
symbol: u16,
vocab_size: usize,
},
InvalidMaxWords(usize),
OddTokenStreamLength(u64),
MissingByteSymbol(u8),
Io(Error),
}Expand description
Errors returned by dictionary preprocessing, loading, encoding, or decoding.
Variants§
InvalidEscape(u8)
Dictionary file contains an unrecognized backslash escape sequence.
WordTooLong
Dictionary entry exceeds the maximum supported word length (4096 bytes).
InvalidSymbol
Token stream contains a symbol ID outside the dictionary bounds.
InvalidMaxWords(usize)
Maximum vocabulary size is invalid (must be at least 256).
OddTokenStreamLength(u64)
Token stream length is not a multiple of 2 bytes.
MissingByteSymbol(u8)
Provided dictionary lacks a single-byte entry needed to encode an arbitrary byte.
Io(Error)
Underlying I/O error.
Trait Implementations§
Source§impl Debug for PreprocessError
impl Debug for PreprocessError
Source§impl Display for PreprocessError
impl Display for PreprocessError
Source§impl Error for PreprocessError
impl Error for PreprocessError
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 PreprocessError
impl !UnwindSafe for PreprocessError
impl Freeze for PreprocessError
impl Send for PreprocessError
impl Sync for PreprocessError
impl Unpin for PreprocessError
impl UnsafeUnpin for PreprocessError
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