Skip to main content

Backend

Trait Backend 

Source
pub trait Backend {
    // Required methods
    fn id(&self) -> &'static str;
    fn extension(&self) -> &'static str;
    fn generate(
        &self,
        ws: &CheckedWorkspace,
        options: &GenOptions,
    ) -> Result<Vec<GeneratedFile>, GenError>;
}
Expand description

A target language this can generate for.

Required Methods§

Source

fn id(&self) -> &'static str

What this backend is called on a command line.

Source

fn extension(&self) -> &'static str

The file extension it produces.

Source

fn generate( &self, ws: &CheckedWorkspace, options: &GenOptions, ) -> Result<Vec<GeneratedFile>, GenError>

Writes out a whole workspace.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§