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 Error for WSError<'_>
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)>
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()
source§impl From<TryFromIntError> for WSError<'_>
impl From<TryFromIntError> for WSError<'_>
source§fn from(err: TryFromIntError) -> Self
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> 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