#[non_exhaustive]pub enum AudioError {
Http(HttpError),
Api {
status: u16,
message: String,
},
InvalidResponse(String),
Unsupported(&'static str),
UnknownProvider(String),
MissingApiKey(&'static str),
Storage(StorageError),
MissingVoice,
MissingModel(&'static str),
InvalidRequest(String),
}Expand description
Errors of speech providers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Http(HttpError)
The request could not be sent or the response could not be read.
Api
The API answered with an error status.
InvalidResponse(String)
The API answered with something the provider cannot read.
Unsupported(&'static str)
The provider cannot do this, for example clone voices.
UnknownProvider(String)
No provider has this name.
MissingApiKey(&'static str)
The environment variable with the API key is not set.
Storage(StorageError)
The audio was made but could not be saved in the storage.
MissingVoice
The request has no voice and the provider needs one.
MissingModel(&'static str)
The provider has no model for this kind of call, so it is off.
InvalidRequest(String)
The request cannot be fulfilled as given.
Implementations§
Trait Implementations§
Source§impl Debug for AudioError
impl Debug for AudioError
Source§impl Display for AudioError
impl Display for AudioError
Source§impl Error for AudioError
impl Error for AudioError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<HttpError> for AudioError
impl From<HttpError> for AudioError
Source§impl From<StorageError> for AudioError
impl From<StorageError> for AudioError
Source§fn from(source: StorageError) -> Self
fn from(source: StorageError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for AudioError
impl !UnwindSafe for AudioError
impl Forget for AudioError
impl Freeze for AudioError
impl Move for AudioError
impl Send for AudioError
impl Sync for AudioError
impl Unpin for AudioError
impl UnsafeUnpin for AudioError
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
Mutably borrows from an owned value. Read more