pub struct Compiler {
pub rust_codegen: RustCodeGenerator,
pub library_resolver: LibraryResolver,
/* private fields */
}Fields§
§rust_codegen: RustCodeGenerator§library_resolver: LibraryResolverResolves declared libraries: (standard/domain/optional/user). The
built-in standard library and base_dir-relative user libraries
resolve automatically; add optional-library search paths with
Compiler::with_library_search_path.
Implementations§
Source§impl Compiler
impl Compiler
pub fn new() -> Self
Sourcepub fn with_library_search_path(self, path: impl Into<PathBuf>) -> Self
pub fn with_library_search_path(self, path: impl Into<PathBuf>) -> Self
Add a search directory for optional (non-std.*) libraries. Checked
in the order added; never consulted for names under the reserved
std. namespace.
Sourcepub fn with_extension(self, extension: Box<dyn EtdlExtension>) -> Self
pub fn with_extension(self, extension: Box<dyn EtdlExtension>) -> Self
Register an additional supplement extension (core spec Section 11.5:
“Defining a New Supplement”). Its validate/process (core spec
Section 11.3) run during Compiler::validate/Compiler::compile
exactly like the built-in Reliability/Tree Event extensions do,
gated the same way: only for a document that actually declares the
extension’s id() under supplements: (core spec Section 5.1.1).
This does not replace or reorder the built-in extensions, which
Compiler::run_extensions continues to handle exactly as before —
it adds a place for anything else to plug in.
Sourcepub fn validate(
&self,
doc: &EtlDocument,
asyncapi_registry: &AsyncApiRegistry,
) -> Vec<Diagnostic>
pub fn validate( &self, doc: &EtlDocument, asyncapi_registry: &AsyncApiRegistry, ) -> Vec<Diagnostic>
Run the full validation pipeline (semantic checks, fault-tree resolution, probability validation, ECEL type checking) without generating any code.
Sourcepub fn validate_with_base(
&self,
doc: &EtlDocument,
asyncapi_registry: &AsyncApiRegistry,
base_dir: &Path,
) -> Vec<Diagnostic>
pub fn validate_with_base( &self, doc: &EtlDocument, asyncapi_registry: &AsyncApiRegistry, base_dir: &Path, ) -> Vec<Diagnostic>
Validate, resolving external reliability sources relative to base_dir.
pub fn compile( &self, doc: &EtlDocument, asyncapi_registry: &AsyncApiRegistry, ) -> CompilationResult
Sourcepub fn compile_with_base(
&self,
doc: &EtlDocument,
asyncapi_registry: &AsyncApiRegistry,
base_dir: &Path,
) -> CompilationResult
pub fn compile_with_base( &self, doc: &EtlDocument, asyncapi_registry: &AsyncApiRegistry, base_dir: &Path, ) -> CompilationResult
Compile with a base directory for resolving relative reliability artifact paths.
Sourcepub fn compile_target(
&self,
doc: &EtlDocument,
asyncapi_registry: &AsyncApiRegistry,
generator: &dyn CodeGenerator,
stem: &str,
) -> TargetCompilationResult
pub fn compile_target( &self, doc: &EtlDocument, asyncapi_registry: &AsyncApiRegistry, generator: &dyn CodeGenerator, stem: &str, ) -> TargetCompilationResult
Compile for an arbitrary registered target (see etdl-cli’s target
registry) rather than the built-in Rust target specifically. stem
is the input document’s filename without extension, used for output
naming exactly like compile_with_base’s Rust path already does.
Sourcepub fn compile_target_with_base(
&self,
doc: &EtlDocument,
asyncapi_registry: &AsyncApiRegistry,
base_dir: &Path,
generator: &dyn CodeGenerator,
stem: &str,
) -> TargetCompilationResult
pub fn compile_target_with_base( &self, doc: &EtlDocument, asyncapi_registry: &AsyncApiRegistry, base_dir: &Path, generator: &dyn CodeGenerator, stem: &str, ) -> TargetCompilationResult
Compiler::compile_target with a base directory for resolving
relative reliability artifact paths.