#[non_exhaustive]pub enum Error {
FeatureDisabled {
name: &'static str,
needed_for: &'static str,
},
PlatformUnsupported {
platform: &'static str,
},
UnknownPreset {
name: String,
known: &'static [&'static str],
},
WatchUnavailable {
reason: &'static str,
},
NoVariant {
mode: ColorMode,
},
Toml(Error),
Io(Error),
ResolutionIncomplete {
missing: Vec<String>,
},
ResolutionInvalid {
errors: Vec<RangeViolation>,
},
ReaderFailed {
reader: &'static str,
source: Box<dyn Error + Send + Sync>,
},
}Expand description
Errors that can occur when reading or processing theme data.
This is a flat enum with 10 variants. Use Error::kind() for coarse
dispatch without matching every variant.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
FeatureDisabled
The platform has a theme reader, but the Cargo feature that compiles it
is not enabled (macos on macOS, windows on Windows).
Fields
PlatformUnsupported
The current platform is not supported.
UnknownPreset
A preset name was not found in the bundled set.
Fields
Theme-change watching is not available: no backend for this desktop environment, or the platform’s feature is disabled.
NoVariant
The theme has no variant for the requested color mode.
Returned by Theme::pick_variant() and
Theme::into_variant() when the theme
has neither a light nor a dark variant set.
Toml(Error)
TOML parsing error. (Serialization errors from Theme::to_toml are
ReaderFailed with reader "toml-serializer".)
Io(Error)
File I/O error.
ResolutionIncomplete
Theme resolution found missing fields that could not be inherited.
ResolutionInvalid
Theme resolution found numeric values outside allowed ranges.
Fields
errors: Vec<RangeViolation>One entry per out-of-range property.
ReaderFailed
A platform reader failed with a platform-specific error.
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()