pub enum WallSwitchError {
Show 23 variants
AtLeastValue {
arg: String,
value: String,
num: u64,
},
AtMostValue {
arg: String,
value: String,
num: u64,
},
DisregardPath(PathBuf),
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,
},
NoImages {
paths: Vec<PathBuf>,
},
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.
DisregardPath(PathBuf)
Error when an image path should be disregarded.
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.
NoImages
Error when no valid images are found in specified directories.
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.