Trait Generator

Source
pub trait Generator<'model>: Sized {
    type Lang: GeneratorNameMapping;

    // Required methods
    fn model(&self) -> &'model Verilization;
    fn scope(&self) -> &Scope<'model>;

    // Provided methods
    fn build_type<'gen>(
        &'gen self,
        version: &BigUint,
        t: &Type,
    ) -> Result<LangType<'model>, GeneratorError> { ... }
    fn build_codec(
        &self,
        t: LangType<'model>,
    ) -> Result<LangExpr<'model>, GeneratorError> { ... }
    fn build_conversion(
        &self,
        prev_ver: &BigUint,
        version: &BigUint,
        t: &Type,
        param: ConvertParam<'model>,
    ) -> Result<LangExpr<'model>, GeneratorError> { ... }
    fn build_value(
        &self,
        version: &BigUint,
        t: LangType<'model>,
        value: ConstantValue,
    ) -> Result<LangExpr<'model>, GeneratorError> { ... }
}

Required Associated Types§

Required Methods§

Source

fn model(&self) -> &'model Verilization

Source

fn scope(&self) -> &Scope<'model>

Provided Methods§

Source

fn build_type<'gen>( &'gen self, version: &BigUint, t: &Type, ) -> Result<LangType<'model>, GeneratorError>

Source

fn build_codec( &self, t: LangType<'model>, ) -> Result<LangExpr<'model>, GeneratorError>

Source

fn build_conversion( &self, prev_ver: &BigUint, version: &BigUint, t: &Type, param: ConvertParam<'model>, ) -> Result<LangExpr<'model>, GeneratorError>

Source

fn build_value( &self, version: &BigUint, t: LangType<'model>, value: ConstantValue, ) -> Result<LangExpr<'model>, GeneratorError>

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§