pub struct AggregatedCompilerOutput {
    pub errors: Vec<Error>,
    pub sources: VersionedSourceFiles,
    pub contracts: VersionedContracts,
    pub build_infos: BTreeMap<Version, RawBuildInfo>,
}
Expand description

The aggregated output of (multiple) compile jobs

This is effectively a solc version aware CompilerOutput

Fields§

§errors: Vec<Error>

all errors from all CompilerOutput

§sources: VersionedSourceFiles

All source files combined with the solc version used to compile them

§contracts: VersionedContracts

All compiled contracts combined with the solc version used to compile them

§build_infos: BTreeMap<Version, RawBuildInfo>

Implementations§

Converts all \\ separators in all paths to /

Whether the output contains a compiler error

Whether the output contains a compiler warning

adds a new CompilerOutput to the aggregated output

Creates all BuildInfo files in the given build_info_dir

There can be multiple BuildInfo, since we support multiple versions.

The created files have the md5 hash {_format,solcVersion,solcLongVersion,input} as their file name

Finds the first contract with the given name

Example
use ethers_solc::Project;
use ethers_solc::artifacts::*;
let output = project.compile().unwrap().output();
let contract = output.find_first("Greeter").unwrap();

Removes the first contract with the given name from the set

Example
use ethers_solc::Project;
use ethers_solc::artifacts::*;
let mut output = project.compile().unwrap().output();
let contract = output.remove_first("Greeter").unwrap();

Removes the contract with matching path and name

Example
use ethers_solc::Project;
use ethers_solc::artifacts::*;
let mut output = project.compile().unwrap().output();
let contract = output.remove("src/Greeter.sol", "Greeter").unwrap();

Removes the contract with matching path and name using the <path>:<contractname> pattern where path is optional.

If the path segment is None, then the first matching Contract is returned, see Self::remove_first

Example
use ethers_solc::Project;
use ethers_solc::artifacts::*;
use ethers_solc::info::ContractInfo;
let mut output = project.compile().unwrap().output();
let info = ContractInfo::new("src/Greeter.sol:Greeter");
let contract = output.remove_contract(&info).unwrap();

Iterate over all contracts and their names

Iterate over all contracts and their names

Returns an iterator over (file, name, Contract)

Returns an iterator over (file, name, Contract)

Returns an iterator over (file, name, Contract, Version)

Returns an iterator over (file, name, Contract, Version)

Given the contract file’s path and the contract’s name, tries to return the contract’s bytecode, runtime bytecode, and abi

Example
use ethers_solc::Project;
use ethers_solc::artifacts::*;
let output = project.compile().unwrap().output();
let contract = output.get("src/Greeter.sol", "Greeter").unwrap();

Returns the output’s source files and contracts separately, wrapped in helper types that provide several helper methods

Example
use ethers_solc::Project;
let output = project.compile().unwrap().output();
let (sources, contracts) = output.split();

Joins all file path with root

Strips the given prefix from all file paths to make them relative to the given base argument.

Convenience method for Self::strip_prefix_all() that consumes the type.

Example

Make all sources and contracts relative to the project’s root directory

use ethers_solc::Project;

let project = Project::builder().build().unwrap();
let output = project.compile().unwrap().output().with_stripped_file_prefixes(project.root());

Removes base from all contract paths

Trait Implementations§

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
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

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

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