pub struct SystemTrayError {
pub message: String,
pub code: i32,
}Expand description
Represents custom error types for the SystemTray application.
Fields§
§message: StringA human-readable error message describing the nature of the error.
code: i32An error code indicating the specific type of error.
Implementations§
Source§impl SystemTrayError
impl SystemTrayError
Sourcepub fn new(code: i32) -> SystemTrayError
pub fn new(code: i32) -> SystemTrayError
Trait Implementations§
Source§impl Debug for SystemTrayError
impl Debug for SystemTrayError
Source§impl Display for SystemTrayError
Implements the Display trait for the custom error type SystemTrayError.
impl Display for SystemTrayError
Implements the Display trait for the custom error type SystemTrayError.
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the error message for display.
§Parameters
f: A mutable reference to afmt::Formatterused for formatting.
§Returns
Returns a fmt::Result indicating the success or failure of the formatting.
§Examples
let error = yarrow_rs::SystemTrayError::new(1);
let formatted_message = format!("{}", error);
println!("{}", formatted_message);Source§impl Error for SystemTrayError
Implements the Error trait for the custom error type SystemTrayError.
impl Error for SystemTrayError
Implements the Error trait for the custom error type SystemTrayError.
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()
Auto Trait Implementations§
impl Freeze for SystemTrayError
impl RefUnwindSafe for SystemTrayError
impl Send for SystemTrayError
impl Sync for SystemTrayError
impl Unpin for SystemTrayError
impl UnwindSafe for SystemTrayError
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