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§

select all outputs the compiler can possibly generate, use { "*": { "*": [ "*" ], "": [ "*" ] } } but note that this might slow down the compilation process needlessly.

Default output selection for compiler output:

{ "*": { "*": [ "*" ], "": [ "abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"] } }

Which enables it for all files and all their contracts (“*” wildcard)

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)

Returns an empty output selection which corresponds to an empty map {}

Trait Implementations§

Converts this type into a mutable reference of the (usually inferred) input type.
Converts this type into a shared reference of the (usually inferred) input type.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more