pub struct AggregatedCompilerOutput {
    pub errors: Vec<Error>,
    pub sources: VersionedSourceFiles,
    pub contracts: VersionedContracts,
}
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

Implementations

Whether the output contains a compiler error

Whether the output contains a compiler warning

adds a new CompilerOutput to the aggregated output

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("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("Greeter").unwrap();

Iterate over all contracts and their names

Iterate over all contracts and their names

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

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 !=.

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