TargetLanguage

Trait TargetLanguage 

Source
pub trait TargetLanguage: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn emit_import(&self, items: &[&str]) -> String;
    fn emit_variable(&self, name: &str, type_: &str, value: &str) -> String;
    fn emit_method_chain(
        &self,
        receiver: &str,
        methods: &[(String, Vec<String>)],
    ) -> String;
    fn emit_await(&self, expr: &str) -> String;
    fn emit_error_handling(&self, expr: &str) -> String;
}
Expand description

Trait for target language code generation

Required Methods§

Source

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

Source

fn emit_import(&self, items: &[&str]) -> String

Source

fn emit_variable(&self, name: &str, type_: &str, value: &str) -> String

Source

fn emit_method_chain( &self, receiver: &str, methods: &[(String, Vec<String>)], ) -> String

Source

fn emit_await(&self, expr: &str) -> String

Source

fn emit_error_handling(&self, expr: &str) -> String

Implementors§