pub enum WallSwitchError {
Show 29 variants
AtLeastValue {
arg: String,
value: String,
num: u64,
},
AtMostValue {
arg: String,
value: String,
num: u64,
},
CommandFailed {
program: String,
status: String,
stderr: String,
},
DesktopDetectionFailed,
DisregardPath(PathBuf),
EnvVarMissing(String),
FromUtf8(FromUtf8Error),
Io(Error),
InvalidDimension(DimensionError),
InvalidFilename(PathBuf),
InvalidSize {
min_size: u64,
size: u64,
max_size: u64,
},
InvalidValue {
arg: String,
value: String,
},
IOError {
path: PathBuf,
io_error: Error,
},
Json(Error),
MaxValue,
MinValue,
MissingValue {
arg: String,
},
MinMax {
min: u64,
max: u64,
},
AwwwDaemonError(String),
MissingWaylandTools,
NoImages {
paths: Vec<PathBuf>,
},
NoMonitors(String),
InvalidOrientation,
InsufficientImages {
paths: Vec<PathBuf>,
nfiles: usize,
},
InsufficientNumber,
Parent(PathBuf),
TryInto(String),
UnableToFind(String),
UnexpectedArg {
arg: String,
},
}Expand description
WallSwitch Error enum
The WallSwitchError enum defines the error values
https://doc.rust-lang.org/rust-by-example/error/multiple_error_types/define_error_type.html
Variants§
AtLeastValue
Error for command-line arguments that have invalid values.
AtMostValue
Error for command-line arguments that have values exceeding a maximum.
CommandFailed
Error for failed command execution instead of panicking
DesktopDetectionFailed
Error when desktop detection fails completely
DisregardPath(PathBuf)
Error when an image path should be disregarded.
EnvVarMissing(String)
Error when a system environment variable is missing
FromUtf8(FromUtf8Error)
Error when failing to convert byte output to a UTF-8 string.
Io(Error)
Standard I/O error wrapper.
InvalidDimension(DimensionError)
Error when an image’s dimensions are invalid.
InvalidFilename(PathBuf)
Error for file paths that have invalid filenames.
InvalidSize
Error for image file sizes that are outside an allowed range.
InvalidValue
Error for command-line arguments that have invalid values.
IOError
Error for I/O operations with an associated file path.
Json(Error)
Error when a JSON serialization or deserialization operation fails.
MaxValue
Error when obtaining the maximum valid value for a parameter.
MinValue
Error when obtaining the minimum valid value for a parameter.
MissingValue
Error for command-line arguments that are missing required values.
MinMax
Error for minimum value being greater than maximum value.
AwwwDaemonError(String)
Error when awww daemon fails to initialize or respond.
MissingWaylandTools
Error when neither swaybg, hyprpaper, nor awww is found on Wayland.
NoImages
Error when no valid images are found in specified directories.
NoMonitors(String)
Error for no active monitors detected
InvalidOrientation
Error for invalid image orientation (e.g., neither horizontal nor vertical).
InsufficientImages
Error for an insufficient number of image files found.
InsufficientNumber
Error when an insufficient number of valid images are present.
Parent(PathBuf)
Error when a directory path does not exist.
TryInto(String)
Error from a generic conversion attempt.
UnableToFind(String)
Error when a binary or resource cannot be found on the system.
UnexpectedArg
Error for unexpected command-line arguments.
Trait Implementations§
Source§impl Debug for WallSwitchError
impl Debug for WallSwitchError
Source§impl Display for WallSwitchError
impl Display for WallSwitchError
Source§impl Error for WallSwitchError
impl Error for WallSwitchError
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()
Source§impl From<DimensionError> for WallSwitchError
impl From<DimensionError> for WallSwitchError
Source§fn from(source: DimensionError) -> Self
fn from(source: DimensionError) -> Self
Source§impl From<Error> for WallSwitchError
impl From<Error> for WallSwitchError
Source§impl From<Error> for WallSwitchError
impl From<Error> for WallSwitchError
Source§impl From<FromUtf8Error> for WallSwitchError
impl From<FromUtf8Error> for WallSwitchError
Source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
Source§impl From<TryFromIntError> for WallSwitchError
impl From<TryFromIntError> for WallSwitchError
Source§fn from(err: TryFromIntError) -> Self
fn from(err: TryFromIntError) -> Self
Auto Trait Implementations§
impl Freeze for WallSwitchError
impl !RefUnwindSafe for WallSwitchError
impl Send for WallSwitchError
impl Sync for WallSwitchError
impl Unpin for WallSwitchError
impl UnsafeUnpin for WallSwitchError
impl !UnwindSafe for WallSwitchError
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> Colors for Twhere
T: Display,
impl<T> Colors for Twhere
T: Display,
fn bold(&self) -> String
fn dimmed(&self) -> String
fn black(&self) -> String
fn red(&self) -> String
fn green(&self) -> String
fn yellow(&self) -> String
fn blue(&self) -> String
fn magenta(&self) -> String
fn cyan(&self) -> String
fn white(&self) -> String
Source§fn to_line_start(&self) -> String
fn to_line_start(&self) -> String
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