#[non_exhaustive]pub enum ImageError {
Http(HttpError),
Api {
status: u16,
message: String,
},
InvalidResponse(String),
Unsupported(&'static str),
UnknownProvider(String),
MissingApiKey(&'static str),
Storage(StorageError),
}Expand description
Errors of image 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 edit images.
UnknownProvider(String)
No provider matches the model name.
MissingApiKey(&'static str)
The environment variable with the API key is not set.
Storage(StorageError)
The image was made but could not be saved in the storage.
Implementations§
Trait Implementations§
Source§impl Debug for ImageError
impl Debug for ImageError
Source§impl Display for ImageError
impl Display for ImageError
Source§impl Error for ImageError
impl Error for ImageError
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 ImageError
impl From<HttpError> for ImageError
Source§impl From<StorageError> for ImageError
impl From<StorageError> for ImageError
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 ImageError
impl !UnwindSafe for ImageError
impl Freeze for ImageError
impl Send for ImageError
impl Sync for ImageError
impl Unpin for ImageError
impl UnsafeUnpin for ImageError
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