pub enum IconError {
Unsupported {
reason: &'static str,
},
Load {
path: PathBuf,
source: Error,
},
Apply(Error),
DegradedSourceUnsupported {
reason: &'static str,
},
Decode(IcoError),
}Expand description
Why setting an icon failed.
Variants§
Unsupported
The host cannot accept an icon at all.
Distinct from an I/O failure: retrying or supplying a different file will not help, and the caller should stop asking.
Load
The icon source could not be loaded.
Apply(Error)
The OS refused to build an icon from otherwise well-formed data.
Removed in #720 because nothing constructed it; reinstated here
because CreateIconFromResourceEx can fail on data this crate has
already validated the shape of — the image itself may still be
something the OS will not decode.
DegradedSourceUnsupported
The host accepts only a symbolic name, and this source is not one.
Distinct from IconError::Unsupported: the host would accept a
stock icon, so the remedy is to pass one rather than to give up.
Decode(IcoError)
The supplied bytes are not a usable icon.
Separate from IconError::Load because the remedy differs: a bad
path is fixed by pointing somewhere else, malformed bytes by fixing
what was embedded.
Trait Implementations§
Source§impl Error for IconError
impl Error for IconError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for IconError
impl !UnwindSafe for IconError
impl Freeze for IconError
impl Send for IconError
impl Sync for IconError
impl Unpin for IconError
impl UnsafeUnpin for IconError
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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