pub trait LanguageGenerator: Send + Sync {
// 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);
// Provided method
fn finalize_generation<'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 { ... }
}Expand description
Interface for language-specific code generators
Required Methods§
Sourcefn 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_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)
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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)
Sourcefn print_next_steps(&self, context: &GenContext)
fn print_next_steps(&self, context: &GenContext)
Print next steps
Provided Methods§
Sourcefn finalize_generation<'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 finalize_generation<'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,
Finalize generation (e.g., set files read-only). Default is no-op.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".