foundry_compilers::compilers

Trait CompilerSettings

source
pub trait CompilerSettings:
    Default
    + Serialize
    + DeserializeOwned
    + Clone
    + Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn update_output_selection(
        &mut self,
        f: impl FnOnce(&mut OutputSelection) + Copy,
    );
    fn can_use_cached(&self, other: &Self) -> bool;

    // Provided methods
    fn with_remappings(self, _remappings: &[Remapping]) -> Self { ... }
    fn with_base_path(self, _base_path: &Path) -> Self { ... }
    fn with_allow_paths(self, _allowed_paths: &BTreeSet<PathBuf>) -> Self { ... }
    fn with_include_paths(self, _include_paths: &BTreeSet<PathBuf>) -> Self { ... }
}
Expand description

Compilation settings including evm_version, output_selection, etc.

Required Methods§

source

fn update_output_selection( &mut self, f: impl FnOnce(&mut OutputSelection) + Copy, )

Executes given fn with mutable reference to configured OutputSelection.

source

fn can_use_cached(&self, other: &Self) -> bool

Returns true if artifacts compiled with given other config are compatible with this config and if compilation can be skipped.

Ensures that all settings fields are equal except for output_selection which is required to be a subset of cached.output_selection.

Provided Methods§

source

fn with_remappings(self, _remappings: &[Remapping]) -> Self

Method which might be invoked to add remappings to the input.

source

fn with_base_path(self, _base_path: &Path) -> Self

Builder method to set the base path for the compiler. Primarily used by solc implementation to se –base-path.

source

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.

source

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.

Object Safety§

This trait is not object safe.

Implementors§