Trait ExportLanguage

Source
pub trait ExportLanguage {
    // Required methods
    fn globals() -> String;
    fn render_functions(
        function_types: Vec<FunctionDataType>,
        cfg: &ExportConfiguration,
    ) -> Result<String, TsExportError>;
    fn render(
        function_types: Vec<FunctionDataType>,
        type_map: TypeDefs,
        cfg: &ExportConfiguration,
    ) -> Result<String, TsExportError>;
}
Expand description

A set of functions that produce language-specific code

Required Methods§

Source

fn globals() -> String

Type definitions and constants that the generated functions rely on

Source

fn render_functions( function_types: Vec<FunctionDataType>, cfg: &ExportConfiguration, ) -> Result<String, TsExportError>

Renders a collection of FunctionDataType into a string.

Source

fn render( function_types: Vec<FunctionDataType>, type_map: TypeDefs, cfg: &ExportConfiguration, ) -> Result<String, TsExportError>

Renders the output of [globals], [render_functions] and all dependant types into a TypeScript string.

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§

Source§

impl ExportLanguage for tauri_specta::js::Language

Available on crate feature javascript only.
Source§

impl ExportLanguage for tauri_specta::ts::Language

Available on crate feature typescript only.