Skip to main content

WallSwitchError

Enum WallSwitchError 

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

Fields

§value: String
§num: u64
§

AtMostValue

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

Fields

§value: String
§num: u64
§

CommandFailed

Error for failed command execution instead of panicking

Fields

§program: String
§status: String
§stderr: String
§

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.

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
§

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.

Fields

§paths: Vec<PathBuf>
§

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.

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 dimmed(&self) -> String

Source§

fn black(&self) -> String

Source§

fn red(&self) -> String

Source§

fn green(&self) -> String

Source§

fn yellow(&self) -> String

Source§

fn blue(&self) -> String

Source§

fn magenta(&self) -> String

Source§

fn cyan(&self) -> String

Source§

fn white(&self) -> String

Source§

fn to_line_start(&self) -> String

Wraps the text to be printed on a single line, clearing the previous content. Idiomatic way to handle progress updates.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.