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§
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>
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.