pub enum Error {
SwapInProgress,
PathNotWritable(PathBuf),
MalformedIcon(&'static str),
Windows(&'static str, u32),
Io(Error),
UnsupportedPlatform,
}Expand description
Everything that can go wrong during a swap.
Variants§
SwapInProgress
Another process is mid-swap on this same executable.
PathNotWritable(PathBuf)
The directory holding the executable cannot be written to.
The crate deliberately stops here rather than copying itself somewhere writable or prompting for elevation: a binary that clones itself around the disk to change a cosmetic detail is exactly the behaviour that gets it flagged, and a UAC prompt in the middle of an icon change is worse than the icon not changing.
MalformedIcon(&'static str)
The .ico could not be parsed. Nothing was written.
Windows(&'static str, u32)
A Win32 call failed, named along with its GetLastError code.
Io(Error)
A filesystem operation failed.
UnsupportedPlatform
The crate only does anything on Windows.
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)>
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()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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