#[non_exhaustive]pub enum SpeechError {
NotConfigured,
LimitExceeded {
limit: SpeechLimit,
actual: u64,
max: u64,
},
UnsupportedFormat(String),
UnsupportedLanguage(String),
InvalidInput(String),
Transient {
retry_after: Option<Duration>,
},
Provider(String),
}Expand description
Speech failures. LimitExceeded is the typed
local refusal, carrying only numbers, safe in a log line as-is; the
variants carrying provider or caller text are scrubbed in Display the
way TextModelError’s are (issue #235), while
Debug still shows the raw string for tests.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotConfigured
No speech provider is wired; nothing is wrong with the request.
LimitExceeded
A local ceiling was crossed and the provider was never called.
UnsupportedFormat(String)
Not among the adapter’s advertised SpeechCapabilities::formats.
UnsupportedLanguage(String)
Not among the adapter’s advertised SpeechCapabilities::languages.
InvalidInput(String)
The request was malformed before any provider saw it.
Transient
Retryable (a 5xx, a 429, a transport error); wait out
retry_after when the provider named one.
Provider(String)
The provider refused the request or the call failed.
Implementations§
Source§impl SpeechError
impl SpeechError
Sourcepub fn retry_after(&self) -> Option<Duration>
pub fn retry_after(&self) -> Option<Duration>
The provider-named back-off, where there was one.
Trait Implementations§
Source§impl Clone for SpeechError
impl Clone for SpeechError
Source§impl Debug for SpeechError
impl Debug for SpeechError
Source§impl Display for SpeechError
impl Display for SpeechError
impl Eq for SpeechError
Source§impl Error for SpeechError
impl Error for SpeechError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for SpeechError
impl PartialEq for SpeechError
impl StructuralPartialEq for SpeechError
Auto Trait Implementations§
impl Freeze for SpeechError
impl RefUnwindSafe for SpeechError
impl Send for SpeechError
impl Sync for SpeechError
impl Unpin for SpeechError
impl UnsafeUnpin for SpeechError
impl UnwindSafe for SpeechError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.