Trait FromBuilder

Source
pub trait FromBuilder {
    type Input;
    type Output;

    // Required method
    fn from_builder(builder: &Self::Input) -> Self::Output;
}
Expand description

§convert builder to exception

§example

impl FromBuilder for SuperException {
    type Output = SuperException;
    type Input = SuperBuilder;
    fn from_builder(builder: &Self::Input) -> Self::Output {
        Self::Output {
            code: builder.code(),
            msg: String::from(builder.msg()),
            level: builder.level(),
        }
    }
}

Required Associated Types§

Source

type Input

builder type

Source

type Output

exception type

Required Methods§

Source

fn from_builder(builder: &Self::Input) -> Self::Output

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§