Trait foundry_compilers::compilers::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 compiler_name(&self) -> Cow<'static, str>;
fn strip_prefix(&mut self, base: &Path);
// Provided methods
fn with_remappings(self, _remappings: Vec<Remapping>) -> Self { ... }
fn with_base_path(self, _base_path: PathBuf) -> Self { ... }
fn with_allow_paths(self, _allowed_paths: BTreeSet<PathBuf>) -> Self { ... }
fn with_include_paths(self, _include_paths: BTreeSet<PathBuf>) -> Self { ... }
}
Expand description
Input of a compiler, including sources and settings used for their compilation.
Required Associated Types§
Required Methods§
sourcefn build(
sources: Sources,
settings: Self::Settings,
language: Self::Language,
version: Version,
) -> Self
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).
sourcefn compiler_name(&self) -> Cow<'static, str>
fn compiler_name(&self) -> Cow<'static, str>
Returns compiler name used by reporters to display output during compilation.
sourcefn strip_prefix(&mut self, base: &Path)
fn strip_prefix(&mut self, base: &Path)
Strips given prefix from all paths.
Provided Methods§
sourcefn with_remappings(self, _remappings: Vec<Remapping>) -> Self
fn with_remappings(self, _remappings: Vec<Remapping>) -> Self
Method which might be invoked to add remappings to the input.
sourcefn with_base_path(self, _base_path: PathBuf) -> Self
fn with_base_path(self, _base_path: PathBuf) -> Self
Builder method to set the base path for the compiler. Primarily used by solc implementation to se –base-path.
sourcefn with_allow_paths(self, _allowed_paths: BTreeSet<PathBuf>) -> Self
fn with_allow_paths(self, _allowed_paths: BTreeSet<PathBuf>) -> Self
Builder method to set the allowed paths for the compiler. Primarily used by solc implementation to set –allow-paths.
sourcefn with_include_paths(self, _include_paths: BTreeSet<PathBuf>) -> Self
fn with_include_paths(self, _include_paths: BTreeSet<PathBuf>) -> Self
Builder method to set the include paths for the compiler. Primarily used by solc implementation to set –include-paths.