Enum wallswitch::WSError

source ·
pub enum WSError<'a> {
Show 20 variants UnableToFind(&'a str), MinValue, MaxValue, Parent(PathBuf), InsufficientNumber, TryInto(String), InvalidDimension(DimensionError), InvalidOrientation, IOError(PathBuf, Error), NoImages(Vec<PathBuf>), InsufficientImages(Vec<PathBuf>, usize), MinMax(u64, u64), MissingValue(&'a str), InvalidValue(&'a str, String), AtLeastValue(&'a str, String, u64), AtMostValue(&'a str, String, u64), UnexpectedArg(String), InvalidSize(u64, u64, u64), DisregardPath(PathBuf), InvalidFilename(PathBuf),
}
Expand description

WallSwitch Error enum

The WSError enum defines the error values

https://doc.rust-lang.org/rust-by-example/error/multiple_error_types/define_error_type.html

Variants§

§

UnableToFind(&'a str)

Unable to find

§

MinValue

Unable to obtain minimum value

§

MaxValue

Unable to obtain maximum value

§

Parent(PathBuf)

Directory path must exist

§

InsufficientNumber

Insufficient number of valid images

§

TryInto(String)

Try to performs the conversion

§

InvalidDimension(DimensionError)

Invalid dimension

§

InvalidOrientation

Invalid orientation

§

IOError(PathBuf, Error)

Writing/Reading error

§

NoImages(Vec<PathBuf>)

No images found

§

InsufficientImages(Vec<PathBuf>, usize)

Insufficient number of image files

§

MinMax(u64, u64)

Minimum value > Maximum value

§

MissingValue(&'a str)

Missing value

§

InvalidValue(&'a str, String)

Invalid value

§

AtLeastValue(&'a str, String, u64)

At least value

§

AtMostValue(&'a str, String, u64)

At most value

§

UnexpectedArg(String)

Unexpected argument

§

InvalidSize(u64, u64, u64)

Invalid file size

§

DisregardPath(PathBuf)

Disregard the file path

§

InvalidFilename(PathBuf)

Invalid file name

Trait Implementations§

source§

impl<'a> Debug for WSError<'a>

source§

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

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

impl Display for WSError<'_>

source§

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

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

impl Error for WSError<'_>

If we want to use std::error::Error in main, we need to implement it for WSError

1.30.0 · 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<TryFromIntError> for WSError<'_>

source§

fn from(err: TryFromIntError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for WSError<'a>

§

impl<'a> !RefUnwindSafe for WSError<'a>

§

impl<'a> Send for WSError<'a>

§

impl<'a> Sync for WSError<'a>

§

impl<'a> Unpin for WSError<'a>

§

impl<'a> !UnwindSafe for WSError<'a>

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§

default 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>,

§

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>,

§

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.