[][src]Struct kern::Fail

pub struct 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]

Create Fail from any Display

pub fn from<T, E>(err: E) -> Result<T, Self> where
    E: Display
[src]

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

impl Hash for Fail[src]

impl Ord for Fail[src]

impl PartialEq<Fail> for Fail[src]

impl PartialOrd<Fail> for Fail[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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.