Trait CompilerInput

Source
pub trait CompilerInput:
    Serialize
    + Send
    + Sync
    + Sized
    + Debug {
    type Settings: CompilerSettings;
    type Language: Language;

    // Required methods
    fn build(
        sources: Sources,
        settings: Self::Settings,
        language: Self::Language,
        version: Version,
    ) -> Self;
    fn language(&self) -> Self::Language;
    fn version(&self) -> &Version;
    fn sources(&self) -> impl Iterator<Item = (&Path, &Source)>;
    fn compiler_name(&self) -> Cow<'static, str>;
    fn strip_prefix(&mut self, base: &Path);
}
Expand description

Input of a compiler, including sources and settings used for their compilation.

Required Associated Types§

Required Methods§

Source

fn build( sources: Sources, settings: Self::Settings, language: Self::Language, version: Version, ) -> Self

Constructs one or multiple inputs from given sources set. Might return multiple inputs in cases when sources need to be divided into sets per language (Yul + Solidity for example).

Source

fn language(&self) -> Self::Language

Returns language of the sources included into this input.

Source

fn version(&self) -> &Version

Returns compiler version for which this input is intended.

Source

fn sources(&self) -> impl Iterator<Item = (&Path, &Source)>

Source

fn compiler_name(&self) -> Cow<'static, str>

Returns compiler name used by reporters to display output during compilation.

Source

fn strip_prefix(&mut self, base: &Path)

Strips given prefix from all paths.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§