pub trait Engine: Transcriber + Sized {
type Config;
const NAME: &'static str;
const MODEL: &'static [ModelDownload];
const INPUT: AudioInputKind;
// Required methods
fn check_from(config: &Self::Config) -> Result<PathBuf, TranscriptionError>;
fn load_from(
config: Self::Config,
cancel: &CancelToken,
) -> Result<Self, TranscriptionError>;
}Expand description
Shared construction contract: an engine name, configuration, validation, and loading.
Required Associated Constants§
const NAME: &'static str
Sourceconst MODEL: &'static [ModelDownload]
const MODEL: &'static [ModelDownload]
The files to download for this engine, all into one folder. Empty when nothing is downloaded for it. An engine that reads a second folder lists that folder’s files in a const of its own.
Sourceconst INPUT: AudioInputKind
const INPUT: AudioInputKind
The one audio representation this engine accepts. Callers read it to hand over the right input instead of guessing and failing at runtime.
Required Associated Types§
Required Methods§
Sourcefn check_from(config: &Self::Config) -> Result<PathBuf, TranscriptionError>
fn check_from(config: &Self::Config) -> Result<PathBuf, TranscriptionError>
Resolves what a load would read, without reading it or starting a child.
fn load_from( config: Self::Config, cancel: &CancelToken, ) -> Result<Self, TranscriptionError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".