Skip to main content

ThumbnailError

Enum ThumbnailError 

Source
#[non_exhaustive]
pub enum ThumbnailError {
#[non_exhaustive]
InvalidUriIdentity { reason: &'static str, },
#[non_exhaustive]
InvalidNamespace { reason: &'static str, },
#[non_exhaustive]
CacheRootUnavailable { reason: &'static str, },
#[non_exhaustive]
InvalidCacheRoot { path: PathBuf, problem: CacheRootProblem, },
#[non_exhaustive]
InvalidCachePath { path: PathBuf, problem: CachePathProblem, },
#[non_exhaustive]
InsecureCacheDirectory { path: PathBuf, problem: CacheDirectoryProblem, },
#[non_exhaustive]
Io { context: &'static str, path: Option<PathBuf>, source: Error, },
#[non_exhaustive]
Png { message: String, },
#[non_exhaustive]
InvalidMetadata { reason: &'static str, },
#[non_exhaustive]
UnsupportedRenderedThumbnail { reason: &'static str, },
#[non_exhaustive]
ResourceLimitExceeded { reason: &'static str, },
#[non_exhaustive]
UnsafeRemoval { reason: &'static str, }, }
Expand description

Errors returned by thumbnail cache identity and filesystem operations.

Reason strings carried by variants are diagnostic text for humans and logs. They are not stable machine-matchable API values; callers should use structured variants and typed validation problems for control flow.

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.
§

#[non_exhaustive]
InvalidUriIdentity

A URI or filename input is not valid for the requested thumbnail context.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§reason: &'static str

Diagnostic reason.

§

#[non_exhaustive]
InvalidNamespace

A cache namespace is not valid for filesystem use.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§reason: &'static str

Diagnostic reason.

§

#[non_exhaustive]
CacheRootUnavailable

The cache root could not be resolved from XDG environment variables.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§reason: &'static str

Diagnostic reason.

§

#[non_exhaustive]
InvalidCacheRoot

An explicitly supplied cache root path is invalid.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§path: PathBuf

Invalid cache root path.

§problem: CacheRootProblem

Typed root problem.

§

#[non_exhaustive]
InvalidCachePath

An explicitly computed cache entry path is invalid.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§path: PathBuf

Invalid cache entry path.

§problem: CachePathProblem

Typed path problem.

§

#[non_exhaustive]
InsecureCacheDirectory

An existing cache directory violates thumbnail cache privacy requirements.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§path: PathBuf

Existing directory path.

§problem: CacheDirectoryProblem

Typed directory problem.

§

#[non_exhaustive]
Io

Filesystem I/O failed.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§context: &'static str

Operation that failed.

§path: Option<PathBuf>

Path involved in the operation, when available.

§source: Error

Underlying I/O error.

§

#[non_exhaustive]
Png

PNG data could not be decoded or encoded.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§message: String

PNG diagnostic message.

§

#[non_exhaustive]
InvalidMetadata

Thumbnail metadata is invalid.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§reason: &'static str

Diagnostic reason.

§

#[non_exhaustive]
UnsupportedRenderedThumbnail

Rendered thumbnail bytes are unsupported.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§reason: &'static str

Diagnostic reason.

§

#[non_exhaustive]
ResourceLimitExceeded

PNG parsing or thumbnail normalization would exceed configured resource limits.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§reason: &'static str

Diagnostic reason.

§

#[non_exhaustive]
UnsafeRemoval

Cache entry removal was refused by safety checks.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§reason: &'static str

Diagnostic reason.

Trait Implementations§

Source§

impl Debug for ThumbnailError

Source§

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

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

impl Display for ThumbnailError

Source§

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

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

impl Error for ThumbnailError

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§

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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.