Skip to main content

Compiler

Struct Compiler 

Source
pub struct Compiler {
    pub rust_codegen: RustCodeGenerator,
    pub library_resolver: LibraryResolver,
    /* private fields */
}

Fields§

§rust_codegen: RustCodeGenerator§library_resolver: LibraryResolver

Resolves 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

Source

pub fn new() -> Self

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn compile( &self, doc: &EtlDocument, asyncapi_registry: &AsyncApiRegistry, ) -> CompilationResult

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Default for Compiler

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.