Skip to main content

Generator

Trait Generator 

Source
pub trait Generator {
    type Err: Into<Error>;

    // Required methods
    fn is_avail(&self, name: &str) -> bool;
    fn generate(&self, name: &str, bin: &str) -> Result<String, Self::Err>;
}

Required Associated Types§

Required Methods§

Source

fn is_avail(&self, name: &str) -> bool

Source

fn generate(&self, name: &str, bin: &str) -> Result<String, Self::Err>

Trait Implementations§

Source§

impl<E> Generator for Box<dyn Generator<Err = E>>
where E: Into<Error>,

Source§

type Err = E

Source§

fn is_avail(&self, name: &str) -> bool

Source§

fn generate( &self, name: &str, bin: &str, ) -> Result<String, <Box<dyn Generator<Err = E>> as Generator>::Err>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<E> Generator for Box<dyn Generator<Err = E>>
where E: Into<Error>,

Source§

type Err = E

Source§

fn is_avail(&self, name: &str) -> bool

Source§

fn generate( &self, name: &str, bin: &str, ) -> Result<String, <Box<dyn Generator<Err = E>> as Generator>::Err>

Implementors§