Struct ethers_solc::AggregatedCompilerOutput
source · [−]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: VersionedSourceFilesAll source files combined with the solc version used to compile them
contracts: VersionedContractsAll compiled contracts combined with the solc version used to compile them
Implementations
sourceimpl AggregatedCompilerOutput
impl AggregatedCompilerOutput
sourcepub fn has_warning(&self, ignored_error_codes: &[u64]) -> bool
pub fn has_warning(&self, ignored_error_codes: &[u64]) -> bool
Whether the output contains a compiler warning
pub fn diagnostics<'a>(
&'a self,
ignored_error_codes: &'a [u64]
) -> OutputDiagnostics<'_>
pub fn is_empty(&self) -> bool
pub fn is_unchanged(&self) -> bool
pub fn extend_all<I>(&mut self, out: I) where
I: IntoIterator<Item = (Version, CompilerOutput)>,
sourcepub fn extend(&mut self, version: Version, output: CompilerOutput)
pub fn extend(&mut self, version: Version, output: CompilerOutput)
adds a new CompilerOutput to the aggregated output
sourcepub fn find(&self, contract: impl AsRef<str>) -> Option<CompactContractRef<'_>>
pub fn find(&self, contract: impl AsRef<str>) -> Option<CompactContractRef<'_>>
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();sourcepub fn remove(&mut self, contract: impl AsRef<str>) -> Option<Contract>
pub fn remove(&mut self, contract: impl AsRef<str>) -> Option<Contract>
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();sourcepub fn contracts_iter(&self) -> impl Iterator<Item = (&String, &Contract)>
pub fn contracts_iter(&self) -> impl Iterator<Item = (&String, &Contract)>
Iterate over all contracts and their names
sourcepub fn contracts_into_iter(self) -> impl Iterator<Item = (String, Contract)>
pub fn contracts_into_iter(self) -> impl Iterator<Item = (String, Contract)>
Iterate over all contracts and their names
sourcepub fn get(&self, path: &str, contract: &str) -> Option<CompactContractRef<'_>>
pub fn get(&self, path: &str, contract: &str) -> Option<CompactContractRef<'_>>
Given the contract file’s path and the contract’s name, tries to return the contract’s bytecode, runtime bytecode, and abi
sourcepub fn split(self) -> (VersionedSourceFiles, VersionedContracts)
pub fn split(self) -> (VersionedSourceFiles, VersionedContracts)
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();sourcepub fn with_stripped_file_prefixes(self, base: impl AsRef<Path>) -> Self
pub fn with_stripped_file_prefixes(self, base: impl AsRef<Path>) -> Self
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());sourcepub fn strip_prefix_all(&mut self, base: impl AsRef<Path>) -> &mut Self
pub fn strip_prefix_all(&mut self, base: impl AsRef<Path>) -> &mut Self
Removes base from all contract paths
Trait Implementations
sourceimpl Clone for AggregatedCompilerOutput
impl Clone for AggregatedCompilerOutput
sourcefn clone(&self) -> AggregatedCompilerOutput
fn clone(&self) -> AggregatedCompilerOutput
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for AggregatedCompilerOutput
impl Debug for AggregatedCompilerOutput
sourceimpl Default for AggregatedCompilerOutput
impl Default for AggregatedCompilerOutput
sourcefn default() -> AggregatedCompilerOutput
fn default() -> AggregatedCompilerOutput
Returns the “default value” for a type. Read more
sourceimpl PartialEq<AggregatedCompilerOutput> for AggregatedCompilerOutput
impl PartialEq<AggregatedCompilerOutput> for AggregatedCompilerOutput
sourcefn eq(&self, other: &AggregatedCompilerOutput) -> bool
fn eq(&self, other: &AggregatedCompilerOutput) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &AggregatedCompilerOutput) -> bool
fn ne(&self, other: &AggregatedCompilerOutput) -> bool
This method tests for !=.
impl StructuralPartialEq for AggregatedCompilerOutput
Auto Trait Implementations
impl RefUnwindSafe for AggregatedCompilerOutput
impl Send for AggregatedCompilerOutput
impl Sync for AggregatedCompilerOutput
impl Unpin for AggregatedCompilerOutput
impl UnwindSafe for AggregatedCompilerOutput
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more