Skip to main content

Convert

Trait Convert 

Source
pub trait Convert<T> {
    // Required methods
    fn de<E>(self) -> Result<T, E>
       where E: Error,
             Self: Sized;
    fn ser<E>(self) -> Result<T, E>
       where E: Error,
             Self: Sized;
    fn restore(self) -> Option<T>
       where Self: Sized;
    fn context<C>(self, context: C) -> Result<T>
       where C: Display + Send + Sync + 'static;
    fn with_context<C, F>(self, f: F) -> Result<T>
       where C: Display + Send + Sync + 'static,
             F: FnOnce() -> C;
}

Required Methods§

Source

fn de<E>(self) -> Result<T, E>
where E: Error, Self: Sized,

Source

fn ser<E>(self) -> Result<T, E>
where E: Error, Self: Sized,

Source

fn restore(self) -> Option<T>
where Self: Sized,

Source

fn context<C>(self, context: C) -> Result<T>
where C: Display + Send + Sync + 'static,

Source

fn with_context<C, F>(self, f: F) -> Result<T>
where C: Display + Send + Sync + 'static, F: FnOnce() -> C,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> Convert<T> for Result<T>