pub enum AvatarHashError {
InvalidUrl(ParseError),
UnsupportedScheme,
Status(StatusCode),
UnsupportedContentType(Option<String>),
TooLarge {
max_bytes: usize,
},
Request(Error),
Decode(ImageError),
}Expand description
Error returned while fetching or hashing an avatar image.
Variants§
InvalidUrl(ParseError)
Avatar URL could not be parsed.
UnsupportedScheme
Only HTTP(S) avatar fetches are supported.
Status(StatusCode)
The server returned a non-success HTTP status.
UnsupportedContentType(Option<String>)
Response content type was absent or outside the image allowlist.
TooLarge
Response advertised or exceeded the configured size limit.
Request(Error)
HTTP client error.
Decode(ImageError)
Image decoder error.
Trait Implementations§
Source§impl Debug for AvatarHashError
impl Debug for AvatarHashError
Source§impl Display for AvatarHashError
impl Display for AvatarHashError
Source§impl Error for AvatarHashError
impl Error for AvatarHashError
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<Error> for AvatarHashError
impl From<Error> for AvatarHashError
Source§impl From<ImageError> for AvatarHashError
impl From<ImageError> for AvatarHashError
Source§fn from(source: ImageError) -> Self
fn from(source: ImageError) -> Self
Converts to this type from the input type.
Source§impl From<ParseError> for AvatarHashError
impl From<ParseError> for AvatarHashError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for AvatarHashError
impl !UnwindSafe for AvatarHashError
impl Freeze for AvatarHashError
impl Send for AvatarHashError
impl Sync for AvatarHashError
impl Unpin for AvatarHashError
impl UnsafeUnpin for AvatarHashError
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