Skip to main content

Language

Trait Language 

Source
pub trait Language {
    type OptionsBuilder;
    type Options;

    // Required methods
    fn name() -> &'static str;
    fn empty_options() -> Self::OptionsBuilder;
    fn add_option(
        builder: &mut Self::OptionsBuilder,
        name: &str,
        value: OsString,
    ) -> Result<(), GeneratorError>;
    fn finalize_options(
        builder: Self::OptionsBuilder,
    ) -> Result<Self::Options, GeneratorError>;
    fn generate<Output: for<'output> OutputHandler<'output>>(
        model: &Verilization,
        options: Self::Options,
        output: &mut Output,
    ) -> Result<(), GeneratorError>;
}
Expand description

Defines a language supported by Verilization.

Required Associated Types§

Source

type OptionsBuilder

An intermediate step for the language options.

Source

type Options

Finalized options.

Required Methods§

Source

fn name() -> &'static str

Gets the name of the language.

Source

fn empty_options() -> Self::OptionsBuilder

Gets an option builder with no options set.

Source

fn add_option( builder: &mut Self::OptionsBuilder, name: &str, value: OsString, ) -> Result<(), GeneratorError>

Sets an option.

Source

fn finalize_options( builder: Self::OptionsBuilder, ) -> Result<Self::Options, GeneratorError>

Ensures that any required options have been set and finalizes the options.

Source

fn generate<Output: for<'output> OutputHandler<'output>>( model: &Verilization, options: Self::Options, output: &mut Output, ) -> Result<(), GeneratorError>

Generates serialization code for the language.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§