pub trait GeneratorFactory: Send + Sync {
// Required methods
fn descriptor(&self) -> &'static GeneratorDescriptor;
fn compile(
&self,
config: &GeneratorConfig,
context: &CompileContext<'_>,
) -> Result<Box<dyn CompiledGenerator>, DiagnosticBag>;
}Expand description
Compiles a GeneratorConfig into a runnable generator.
Required Methods§
Sourcefn descriptor(&self) -> &'static GeneratorDescriptor
fn descriptor(&self) -> &'static GeneratorDescriptor
This generator’s static description.
Sourcefn compile(
&self,
config: &GeneratorConfig,
context: &CompileContext<'_>,
) -> Result<Box<dyn CompiledGenerator>, DiagnosticBag>
fn compile( &self, config: &GeneratorConfig, context: &CompileContext<'_>, ) -> Result<Box<dyn CompiledGenerator>, DiagnosticBag>
Validate config and build a runtime generator, or return a
DiagnosticBag describing every problem found.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".