Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 17 variants NoCacheDir, Io { path: PathBuf, source: Error, }, Http { url: String, source: Error, }, HttpStatus { url: String, status: u16, }, SizeMismatch { path: PathBuf, expected: u64, actual: u64, }, Cancelled, SampleRate { expected: u32, actual: u32, }, Channels { actual: u16, }, Capture { message: String, }, WorkerSpawn { message: String, }, ModelLoad { path: PathBuf, message: String, }, Recognition { message: String, }, EngineStopped, StalePartial { path: PathBuf, source: Error, }, HashMismatch { path: PathBuf, expected: String, actual: String, }, Catalogue { message: String, }, Bench { message: String, },
}
Expand description

Everything this crate can fail with.

Variants§

§

NoCacheDir

No models directory was configured and the platform cache directory could not be resolved.

§

Io

A filesystem operation on path failed. A transfer that dies mid-body lands here too rather than in Error::Http: it surfaces while reading the response, and path labels the partial being written rather than naming what actually failed.

Fields

§path: PathBuf
§source: Error
§

Http

The request failed before any body arrived - connection, TLS, or a refused handshake.

Fields

§source: Error
§

HttpStatus

The server answered, but not with the file.

Fields

§status: u16
§

SizeMismatch

A file on disk is not the length the spec records. The usual cause is an interrupted download that was never resumed.

Fields

§path: PathBuf
§expected: u64
§actual: u64
§

Cancelled

Work was stopped on request rather than by a fault: a progress callback returning Break during a fetch, or an abandoned crate::Ticket aborting an inference.

Whatever already finished is kept - a model that reached crate::Progress::Ready is installed - and any partial transfer is left where it is, so a later call resumes rather than starting over.

§

SampleRate

The source declares a rate the models cannot read. Rejected rather than resampled: a silent resample yields plausible text from the wrong signal, and nothing downstream can detect that.

Fields

§expected: u32
§actual: u32
§

Channels

The source declares more than one channel. Interleaved stereo read as mono is a plausible doubled-rate signal, not an error, so it is refused at the boundary.

Fields

§actual: u16
§

Capture

Opening or running the input stream failed.

Fields

§message: String
§

WorkerSpawn

The transcription worker could not be started.

Fields

§message: String
§

ModelLoad

The weights could not be loaded.

Fields

§path: PathBuf
§message: String
§

Recognition

Recognition itself failed.

Fields

§message: String
§

EngineStopped

The worker is gone, so nothing can be transcribed and no queued result will ever arrive.

§

StalePartial

A partial does not match its spec and could not be removed, so every later call fails identically until someone clears it. The usual cause is a models directory that is not writable.

Fields

§path: PathBuf
§source: Error
§

HashMismatch

A file on disk is the right length but the wrong bytes.

Fields

§path: PathBuf
§expected: String
§actual: String
§

Catalogue

A catalogue document is not an entry this build reads.

Fields

§message: String
§

Bench

A bench’s corpus could not be read: a wav that is not the shape this crate reads, or a fixture set that disagrees with itself.

Fields

§message: String

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more