Enum HyprError
pub enum HyprError {
SerdeError(Error),
IoError(Error),
FromUtf8Error(FromUtf8Error),
NotOkDispatch(String),
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
FromUtf8Error(FromUtf8Error)
Error that occurs when parsing UTF-8 string
NotOkDispatch(String)
Dispatcher returned non ok
value
Internal(String)
Internal Hyprland error
Other(String)
Error that occurs for other reasons. Avoid using this.
Implementations§
§impl HyprError
impl HyprError
pub fn try_as_cloned(&self) -> Result<HyprError, &HyprError>
pub fn try_as_cloned(&self) -> Result<HyprError, &HyprError>
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§
§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()
§impl From<FromUtf8Error> for HyprError
impl From<FromUtf8Error> for HyprError
§fn from(error: FromUtf8Error) -> HyprError
fn from(error: FromUtf8Error) -> HyprError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for HyprError
impl !RefUnwindSafe for HyprError
impl Send for HyprError
impl Sync for HyprError
impl Unpin for HyprError
impl !UnwindSafe 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