LanguageGenerator

Trait LanguageGenerator 

Source
pub trait LanguageGenerator: Send {
    // Required methods
    fn generate_infrastructure<'life0, 'life1, 'async_trait>(
        &'life0 self,
        context: &'life1 GenContext,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<PathBuf>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn generate_scaffold<'life0, 'life1, 'async_trait>(
        &'life0 self,
        context: &'life1 GenContext,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<PathBuf>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn format_code<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        context: &'life1 GenContext,
        files: &'life2 [PathBuf],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn validate_code<'life0, 'life1, 'async_trait>(
        &'life0 self,
        context: &'life1 GenContext,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn print_next_steps(&self, context: &GenContext);
}
Expand description

Interface for language-specific code generators

Required Methods§

Source

fn generate_infrastructure<'life0, 'life1, 'async_trait>( &'life0 self, context: &'life1 GenContext, ) -> Pin<Box<dyn Future<Output = Result<Vec<PathBuf>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Generate infrastructure code (e.g., protobuf types, actors)

Source

fn generate_scaffold<'life0, 'life1, 'async_trait>( &'life0 self, context: &'life1 GenContext, ) -> Pin<Box<dyn Future<Output = Result<Vec<PathBuf>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Generate user code scaffold

Source

fn format_code<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, context: &'life1 GenContext, files: &'life2 [PathBuf], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Format generated code using language-specific tools

Source

fn validate_code<'life0, 'life1, 'async_trait>( &'life0 self, context: &'life1 GenContext, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate generated code (e.g., using a compiler)

Source

fn print_next_steps(&self, context: &GenContext)

Print next steps

Implementors§