Skip to main content

SourceProvider

Trait SourceProvider 

Source
pub trait SourceProvider {
    // Required method
    fn get_source(&self, path: &str) -> Option<String>;

    // Provided methods
    fn exists(&self, path: &str) -> bool { ... }
    fn list_sources(&self) -> Vec<String> { ... }
}
Expand description

Provides source code content for compilation.

This trait abstracts away file system access, allowing the compiler to work with in-memory sources (useful for WASM and testing).

Required Methods§

Source

fn get_source(&self, path: &str) -> Option<String>

Get the source code for a given file path

Provided Methods§

Source

fn exists(&self, path: &str) -> bool

Check if a source file exists

Source

fn list_sources(&self) -> Vec<String>

List available source files (for module resolution)

Implementors§