marek_speech_recognition_api/
error.rs

1use std::error::Error;
2use std::fmt::{Display, Formatter};
3use std::path::PathBuf;
4
5#[non_exhaustive]
6#[derive(Debug, Clone, PartialEq)]
7pub enum SpeechError {
8    LoadLibraryError(String),
9    NoLanguageFound(String),
10    LanguageFolderError(PathBuf),
11    Unknown,
12}
13
14impl Display for SpeechError {
15    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
16        write!(f, "{:?}", self)
17    }
18}
19
20impl Error for SpeechError {}
21
22pub type SpeechResult<T = (), E = SpeechError> = Result<T, E>;