Struct ethers_solc::artifacts::output_selection::OutputSelection
source · pub struct OutputSelection(pub BTreeMap<String, FileOutputSelection>);
Expand description
Represents the selected output of files and contracts The first level key is the file name and the second level key is the contract name. An empty contract name is used for outputs that are not tied to a contract but to the whole source file like the AST. A star as contract name refers to all contracts in the file. Similarly, a star as a file name matches all files. To select all outputs the compiler can possibly generate, use “outputSelection: { “”: { “”: [ “” ], “”: [ “” ] } }“ but note that this might slow down the compilation process needlessly.
The available output types are as follows:
File level (needs empty string as contract name): ast - AST of all source files
Contract level (needs the contract name or “”): abi - ABI devdoc - Developer documentation (natspec) userdoc - User documentation (natspec) metadata - Metadata ir - Yul intermediate representation of the code before optimization irOptimized - Intermediate representation after optimization storageLayout - Slots, offsets and types of the contract’s state variables. evm.assembly - New assembly format evm.legacyAssembly - Old-style assembly format in JSON evm.bytecode.functionDebugData - Debugging information at function level evm.bytecode.object - Bytecode object evm.bytecode.opcodes - Opcodes list evm.bytecode.sourceMap - Source mapping (useful for debugging) evm.bytecode.linkReferences - Link references (if unlinked object) evm.bytecode.generatedSources - Sources generated by the compiler evm.deployedBytecode - Deployed bytecode (has all the options that evm.bytecode has) evm.deployedBytecode.immutableReferences - Map from AST ids to bytecode ranges that reference immutables evm.methodIdentifiers - The list of function hashes evm.gasEstimates - Function gas estimates ewasm.wast - Ewasm in WebAssembly S-expressions format ewasm.wasm - Ewasm in WebAssembly binary format
Note that using a using evm
, evm.bytecode
, ewasm
, etc. will select
every target part of that output. Additionally, *
can be used as a
wildcard to request everything.
The default output selection is
{
"*": {
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers"
],
"": [
"ast"
]
}
}
Tuple Fields§
§0: BTreeMap<String, FileOutputSelection>
Implementations§
source§impl OutputSelection
impl OutputSelection
sourcepub fn complete_output_selection() -> Self
pub fn complete_output_selection() -> Self
select all outputs the compiler can possibly generate, use
{ "*": { "*": [ "*" ], "": [ "*" ] } }
but note that this might slow down the compilation process needlessly.
sourcepub fn default_output_selection() -> Self
pub fn default_output_selection() -> Self
Default output selection for compiler output:
{ "*": { "*": [ "*" ], "": [ "abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"] } }
Which enables it for all files and all their contracts (“*” wildcard)
sourcepub fn default_file_output_selection() -> FileOutputSelection
pub fn default_file_output_selection() -> FileOutputSelection
Default output selection for a single file:
{ "*": [ "*" ], "": [ "abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"] }
Which enables it for all the contracts in the file (“*” wildcard)
sourcepub fn empty_file_output_select() -> FileOutputSelection
pub fn empty_file_output_select() -> FileOutputSelection
Returns an empty output selection which corresponds to an empty map {}
Trait Implementations§
source§impl Clone for OutputSelection
impl Clone for OutputSelection
source§fn clone(&self) -> OutputSelection
fn clone(&self) -> OutputSelection
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for OutputSelection
impl Debug for OutputSelection
source§impl Default for OutputSelection
impl Default for OutputSelection
source§fn default() -> OutputSelection
fn default() -> OutputSelection
source§impl<'de> Deserialize<'de> for OutputSelection
impl<'de> Deserialize<'de> for OutputSelection
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 PartialEq for OutputSelection
impl PartialEq for OutputSelection
source§fn eq(&self, other: &OutputSelection) -> bool
fn eq(&self, other: &OutputSelection) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for OutputSelection
impl Serialize for OutputSelection
impl Eq for OutputSelection
impl StructuralPartialEq for OutputSelection
Auto Trait Implementations§
impl RefUnwindSafe for OutputSelection
impl Send for OutputSelection
impl Sync for OutputSelection
impl Unpin for OutputSelection
impl UnwindSafe for OutputSelection
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.