Struct ethers_solc::artifacts::Settings
source · pub struct Settings {
pub stop_after: Option<String>,
pub remappings: Vec<Remapping>,
pub optimizer: Optimizer,
pub model_checker: Option<ModelCheckerSettings>,
pub metadata: Option<SettingsMetadata>,
pub output_selection: OutputSelection,
pub evm_version: Option<EvmVersion>,
pub via_ir: Option<bool>,
pub debug: Option<DebuggingSettings>,
pub libraries: Libraries,
}
Fields§
§stop_after: Option<String>
Stop compilation after the given stage. since 0.8.11: only “parsing” is valid here
remappings: Vec<Remapping>
§optimizer: Optimizer
§model_checker: Option<ModelCheckerSettings>
Model Checker options.
metadata: Option<SettingsMetadata>
Metadata settings
output_selection: OutputSelection
This field can be used to select desired outputs based on file and contract names. If this field is omitted, then the compiler loads and does type checking, but will not generate any outputs apart from errors.
evm_version: Option<EvmVersion>
§via_ir: Option<bool>
Change compilation pipeline to go through the Yul intermediate representation. This is false by default.
debug: Option<DebuggingSettings>
§libraries: Libraries
Addresses of the libraries. If not all libraries are given here, it can result in unlinked objects whose output data is different.
The top level key is the name of the source file where the library is used. If remappings are used, this source file should match the global path after remappings were applied. If this key is an empty string, that refers to a global level.
Implementations§
source§impl Settings
impl Settings
sourcepub fn new(output_selection: impl Into<OutputSelection>) -> Self
pub fn new(output_selection: impl Into<OutputSelection>) -> Self
Creates a new Settings
instance with the given output_selection
sourcepub fn sanitized(self, version: &Version) -> Self
pub fn sanitized(self, version: &Version) -> Self
Consumes the type and returns a Settings::sanitize version
sourcepub fn sanitize(&mut self, version: &Version)
pub fn sanitize(&mut self, version: &Version)
This will remove/adjust values in the settings that are not compatible with this version.
sourcepub fn push_all(
&mut self,
settings: impl IntoIterator<Item = ContractOutputSelection>
)
pub fn push_all( &mut self, settings: impl IntoIterator<Item = ContractOutputSelection> )
Inserts a set of ContractOutputSelection
sourcepub fn with_extra_output(
self,
settings: impl IntoIterator<Item = ContractOutputSelection>
) -> Self
pub fn with_extra_output( self, settings: impl IntoIterator<Item = ContractOutputSelection> ) -> Self
Inserts a set of ContractOutputSelection
sourcepub fn push_output_selection(&mut self, value: impl ToString)
pub fn push_output_selection(&mut self, value: impl ToString)
Inserts the value for all files and contracts
use ethers_solc::artifacts::output_selection::ContractOutputSelection;
use ethers_solc::artifacts::Settings;
let mut selection = Settings::default();
selection.push_output_selection(ContractOutputSelection::Metadata);
sourcepub fn push_contract_output_selection(
&mut self,
contracts: impl Into<String>,
value: impl ToString
)
pub fn push_contract_output_selection( &mut self, contracts: impl Into<String>, value: impl ToString )
Inserts the key
value
pair to the output_selection
for all files
If the key
already exists, then the value is added to the existing list
sourcepub fn set_output_selection(
&mut self,
values: impl IntoIterator<Item = impl ToString>
)
pub fn set_output_selection( &mut self, values: impl IntoIterator<Item = impl ToString> )
Sets the value for all files and contracts
sourcepub fn set_contract_output_selection(
&mut self,
key: impl Into<String>,
values: impl IntoIterator<Item = impl ToString>
)
pub fn set_contract_output_selection( &mut self, key: impl Into<String>, values: impl IntoIterator<Item = impl ToString> )
Sets the key
to the values
pair to the output_selection
for all files
This will replace the existing values for key
if they’re present
sourcepub fn set_via_ir(self, via_ir: bool) -> Self
pub fn set_via_ir(self, via_ir: bool) -> Self
Sets the ``viaIR` valu
sourcepub fn with_via_ir(self) -> Self
pub fn with_via_ir(self) -> Self
Enables viaIR
sourcepub fn with_via_ir_minimum_optimization(self) -> Self
pub fn with_via_ir_minimum_optimization(self) -> Self
Enable viaIR
and use the minimum optimization settings
This is useful in the following scenarios:
- When compiling for test coverage, this can resolve the “stack too deep” error while still giving a relatively accurate source mapping
- When compiling for test, this can reduce the compilation time
sourcepub fn with_base_path(self, base: impl AsRef<Path>) -> Self
pub fn with_base_path(self, base: impl AsRef<Path>) -> Self
Strips base
from all paths
Trait Implementations§
source§impl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<SolcConfig> for Settings
impl From<SolcConfig> for Settings
source§fn from(config: SolcConfig) -> Self
fn from(config: SolcConfig) -> Self
source§impl PartialEq for Settings
impl PartialEq for Settings
impl Eq for Settings
impl StructuralPartialEq for Settings
Auto Trait Implementations§
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnwindSafe for Settings
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.