#[non_exhaustive]pub enum Error {
Show 26 variants
NoModel,
InvalidAlphabet,
InvalidShape,
InvalidScorer,
ModelIncompatible,
ScorerNotEnabled,
ScorerUnreadable,
ScorerInvalidHeader,
ScorerNoTrie,
ScorerInvalidTrie,
ScorerVersionMismatch,
InitMmapFailed,
InitSessionFailed,
InterpreterFailed,
RunSessionFailed,
CreateStreamFailed,
ReadProtoBufFailed,
CreateSessionFailed,
CreateModelFailed,
InsertHotWordFailed,
ClearHotWordsFailed,
EraseHotWordFailed,
Other(i32),
Unknown,
NulBytesFound,
Utf8Error(FromUtf8Error),
}
Expand description
All possible errors returned by the C API plus some Rust errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoModel
Missing model information.
InvalidAlphabet
Invalid alphabet embedded in model. (Data corruption?)
InvalidShape
Invalid model shape.
InvalidScorer
Invalid scorer file.
ModelIncompatible
Incompatible model.
ScorerNotEnabled
External scorer is not enabled.
ScorerUnreadable
Could not read scorer file.
ScorerInvalidHeader
Could not recognize language model header in scorer.
ScorerNoTrie
Reached end of scorer file before loading vocabulary trie.
ScorerInvalidTrie
Invalid magic in trie header.
ScorerVersionMismatch
Scorer file version does not match expected version.
InitMmapFailed
Failed to initialize memory mapped model.
InitSessionFailed
Failed to initialize the session.
InterpreterFailed
Interpreter failed.
RunSessionFailed
Failed to run the session.
CreateStreamFailed
Error creating the stream.
ReadProtoBufFailed
Error reading the proto buffer model file.
CreateSessionFailed
Failed to create session.
CreateModelFailed
Could not allocate model state.
InsertHotWordFailed
Could not insert hot-word.
ClearHotWordsFailed
Could not clear hot-words.
EraseHotWordFailed
Could not erase hot-word.
Other(i32)
An unknown error was returned.
Unknown
An unknown error was returned.
NulBytesFound
Null bytes were found in a string passed in.
Utf8Error(FromUtf8Error)
A string returned by libstt
contained invalid UTF-8.