Trait blazesym::IntoError

source ·
pub trait IntoError<T>: Sealedwhere
    Self: Sized,{
    // Required method
    fn ok_or_error<C, F>(self, kind: ErrorKind, f: F) -> Result<T, Error>
       where C: ToString,
             F: FnOnce() -> C;

    // Provided methods
    fn ok_or_invalid_data<C, F>(self, f: F) -> Result<T, Error>
       where C: ToString,
             F: FnOnce() -> C { ... }
    fn ok_or_invalid_input<C, F>(self, f: F) -> Result<T, Error>
       where C: ToString,
             F: FnOnce() -> C { ... }
    fn ok_or_unexpected_eof<C, F>(self, f: F) -> Result<T, Error>
       where C: ToString,
             F: FnOnce() -> C { ... }
}
Expand description

A trait providing conversion shortcuts for creating Error instances.

Required Methods§

source

fn ok_or_error<C, F>(self, kind: ErrorKind, f: F) -> Result<T, Error>where C: ToString, F: FnOnce() -> C,

Provided Methods§

source

fn ok_or_invalid_data<C, F>(self, f: F) -> Result<T, Error>where C: ToString, F: FnOnce() -> C,

source

fn ok_or_invalid_input<C, F>(self, f: F) -> Result<T, Error>where C: ToString, F: FnOnce() -> C,

source

fn ok_or_unexpected_eof<C, F>(self, f: F) -> Result<T, Error>where C: ToString, F: FnOnce() -> C,

Implementations on Foreign Types§

source§

impl<T> IntoError<T> for Option<T>

source§

fn ok_or_error<C, F>(self, kind: ErrorKind, f: F) -> Result<T, Error>where C: ToString, F: FnOnce() -> C,

Implementors§