pub enum HyprError {
SerdeError(Error),
IoError(Error),
InvalidHyprColorFormat,
InvalidHyprGradiantFormat,
FromUtf8Error(FromUtf8Error),
NotOkDispatch(String),
Hyprpaper(Error),
InvalidOptionKey(String),
InvalidOptionValue,
Internal(String),
Other(String),
}Expand description
Error that unifies different error types used by Hyprland-rs
Variants§
SerdeError(Error)
Error coming from serde
IoError(Error)
Error coming from std::io
InvalidHyprColorFormat
Error from failing to parse HyprColor
InvalidHyprGradiantFormat
Error from failing to parse HyprGradient
FromUtf8Error(FromUtf8Error)
Error that occurs when parsing UTF-8 string
NotOkDispatch(String)
Dispatcher returned non ok value
Hyprpaper(Error)
Error when interacting with Hyprpaper.
InvalidOptionKey(String)
Keyword does not exist
InvalidOptionValue
Unparsable Option
Internal(String)
Internal Hyprland error
Other(String)
Error that occurs for other reasons. Avoid using this.
Implementations§
Source§impl HyprError
impl HyprError
Sourcepub fn try_as_cloned(&self) -> Result<Self, &Self>
pub fn try_as_cloned(&self) -> Result<Self, &Self>
Try to get an owned version of the internal error.
Some dependencies of hyprland do not impl Clone in their error types. This is a partial workaround.
If it succeeds, it returns the owned version of HyprError in Ok(). Otherwise, it returns a reference to the error type.
Trait Implementations§
Source§impl Error for HyprError
impl Error for HyprError
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<FromUtf8Error> for HyprError
impl From<FromUtf8Error> for HyprError
Source§fn from(error: FromUtf8Error) -> Self
fn from(error: FromUtf8Error) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for HyprError
impl !UnwindSafe for HyprError
impl Freeze for HyprError
impl Send for HyprError
impl Sync for HyprError
impl Unpin for HyprError
impl UnsafeUnpin for HyprError
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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