[−]Struct libhandy4::Error
A generic error capable of representing various error domains (types).
Implementations
impl Error
pub fn new<T>(error: T, message: &str) -> Error where
T: ErrorDomain,
T: ErrorDomain,
Creates an error with supplied error enum variant and message.
pub fn is<T>(&self) -> bool where
T: ErrorDomain,
T: ErrorDomain,
Checks if the error domain matches T
.
pub fn kind<T>(&self) -> Option<T> where
T: ErrorDomain,
T: ErrorDomain,
Tries to convert to a specific error enum.
Returns Some
if the error belongs to the enum's error domain and
None
otherwise.
Examples
ⓘThis example is not tested
if let Some(file_error) = error.kind::<FileError>() { match file_error { FileError::Exist => ... FileError::Isdir => ... ... } }
ⓘThis example is not tested
match error.kind::<FileError>() { Some(FileError::Exist) => ... Some(FileError::Isdir) => ... ... }
Trait Implementations
impl Clone for Error
pub fn clone(&self) -> Error
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Error
impl Display for Error
impl Eq for Error
impl Error for Error
pub fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
pub fn backtrace(&self) -> Option<&Backtrace>
[src]
pub fn description(&self) -> &str
1.0.0[src]
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl Hash for Error
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Error
pub fn cmp(&self, other: &Error) -> Ordering
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Error> for Error
impl PartialOrd<Error> for Error
pub fn partial_cmp(&self, other: &Error) -> Option<Ordering>
pub fn lt(&self, other: &Error) -> bool
pub fn le(&self, other: &Error) -> bool
pub fn gt(&self, other: &Error) -> bool
pub fn ge(&self, other: &Error) -> bool
impl Send for Error
impl StaticType for Error
pub fn static_type() -> Type
impl StructuralEq for Error
impl StructuralPartialEq for Error
impl Sync for Error
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToSendValue for T where
T: ToValue + SetValue + Send + ?Sized,
T: ToValue + SetValue + Send + ?Sized,
pub fn to_send_value(&self) -> SendValue
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> ToValue for T where
T: SetValue + ?Sized,
T: SetValue + ?Sized,
pub fn to_value(&self) -> Value
pub fn to_value_type(&self) -> Type
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,