Trait CompilerSettings

Source
pub trait CompilerSettings:
    Default
    + Serialize
    + DeserializeOwned
    + Clone
    + Debug
    + Send
    + Sync
    + 'static {
    type Restrictions: CompilerSettingsRestrictions;

    // Required methods
    fn update_output_selection(
        &mut self,
        f: impl FnOnce(&mut OutputSelection) + Copy,
    );
    fn can_use_cached(&self, other: &Self) -> bool;
    fn satisfies_restrictions(&self, restrictions: &Self::Restrictions) -> 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 Associated Types§

Source

type Restrictions: CompilerSettingsRestrictions

We allow configuring settings restrictions which might optionally contain specific requiremets for compiler configuration. e.g. min/max evm_version, optimizer runs

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.

Source

fn satisfies_restrictions(&self, restrictions: &Self::Restrictions) -> bool

Returns whether current settings satisfy given restrictions.

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.

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§