WallSwitchError

Enum WallSwitchError 

Source
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.

Fields

§value: String
§num: u64
§

AtMostValue

Error for command-line arguments that have values exceeding a maximum.

Fields

§value: String
§num: u64
§

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.

Fields

§min_size: u64
§size: u64
§max_size: u64
§

InvalidValue

Error for command-line arguments that have invalid values.

Fields

§value: String
§

IOError

Error for I/O operations with an associated file path.

Fields

§path: PathBuf
§io_error: Error
§

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.

Fields

§

MinMax

Error for minimum value being greater than maximum value.

Fields

§min: u64
§max: u64
§

NoImages

Error when no valid images are found in specified directories.

Fields

§paths: Vec<PathBuf>
§

InvalidOrientation

Error for invalid image orientation (e.g., neither horizontal nor vertical).

§

InsufficientImages

Error for an insufficient number of image files found.

Fields

§paths: Vec<PathBuf>
§nfiles: usize
§

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.

Fields

Trait Implementations§

Source§

impl Debug for WallSwitchError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for WallSwitchError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for WallSwitchError

Source§

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

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<DimensionError> for WallSwitchError

Source§

fn from(source: DimensionError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for WallSwitchError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for WallSwitchError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<FromUtf8Error> for WallSwitchError

Source§

fn from(source: FromUtf8Error) -> Self

Converts to this type from the input type.
Source§

impl From<TryFromIntError> for WallSwitchError

Source§

fn from(err: TryFromIntError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Colors for T
where T: Display,

Source§

fn bold(&self) -> String

Source§

fn red(&self) -> String

Source§

fn green(&self) -> String

Source§

fn yellow(&self) -> String

Source§

fn blue(&self) -> String

Source§

impl<T> Countable for T
where T: ToString,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.