Skip to main content

Loader

Trait Loader 

Source
pub trait Loader: Send + Sync {
    // Required method
    fn load(
        &self,
        dir: &DiscoveredDir,
        ctx: &LoadContext<'_>,
    ) -> Result<RawComponent>;
}
Expand description

Loader trait. Phase 2 ships a single implementation, HclEditLoader; downstream may swap an in-memory variant for integration tests.

Required Methods§

Source

fn load( &self, dir: &DiscoveredDir, ctx: &LoadContext<'_>, ) -> Result<RawComponent>

Read every HCL-shaped file in dir and produce a RawComponent.

§Errors

Returns crate::Error for fatal I/O outside per-file scope (e.g. a directory disappearing mid-walk). Per-file errors / limit breaches surface as Diagnostics on the returned RawComponent, and the loader continues with the remaining files.

Implementors§