[−][src]Struct kern::Fail
Fail structure
use kern::Fail; fn do_something() -> Result<(), Fail> { let err = Fail::new("This is an error"); Fail::from(err) } println!("{}", do_something().unwrap_err());
Implementations
impl Fail
[src]
pub fn new<E>(err: E) -> Self where
E: Display,
[src]
E: Display,
Create Fail from any Display
pub fn from<T, E>(err: E) -> Result<T, Self> where
E: Display,
[src]
E: Display,
Create Result with Fail from any Display
pub fn err_msg(&self) -> &str
[src]
Get error message
Trait Implementations
impl Clone for Fail
[src]
impl Debug for Fail
[src]
impl Display for Fail
[src]
Display implementation for Fail
impl Eq for Fail
[src]
impl Error for Fail
[src]
std::error::Error implementation for Fail
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn description(&self) -> &str
1.0.0[src]
fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl Hash for Fail
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Fail
[src]
fn cmp(&self, other: &Fail) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Fail> for Fail
[src]
impl PartialOrd<Fail> for Fail
[src]
fn partial_cmp(&self, other: &Fail) -> Option<Ordering>
[src]
fn lt(&self, other: &Fail) -> bool
[src]
fn le(&self, other: &Fail) -> bool
[src]
fn gt(&self, other: &Fail) -> bool
[src]
fn ge(&self, other: &Fail) -> bool
[src]
impl StructuralEq for Fail
[src]
impl StructuralPartialEq for Fail
[src]
Auto Trait Implementations
impl RefUnwindSafe for Fail
impl Send for Fail
impl Sync for Fail
impl Unpin for Fail
impl UnwindSafe for Fail
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,