Struct ethers_solc::artifacts::CompilerOutput
source · pub struct CompilerOutput {
pub errors: Vec<Error>,
pub sources: BTreeMap<String, SourceFile>,
pub contracts: Contracts,
}
Expand description
Output type solc
produces
Fields§
§errors: Vec<Error>
§sources: BTreeMap<String, SourceFile>
§contracts: Contracts
Implementations§
source§impl CompilerOutput
impl CompilerOutput
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
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
sourcepub fn remove(&mut self, contract: impl AsRef<str>) -> Option<Contract>
pub fn remove(&mut self, contract: impl AsRef<str>) -> Option<Contract>
Finds the first contract with the given name and removes it from the set
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) -> (SourceFiles, OutputContracts)
pub fn split(self) -> (SourceFiles, OutputContracts)
Returns the output’s source files and contracts separately, wrapped in helper types that provide several helper methods
sourcepub fn retain_files<'a, I>(&mut self, files: I)where
I: IntoIterator<Item = &'a str>,
pub fn retain_files<'a, I>(&mut self, files: I)where
I: IntoIterator<Item = &'a str>,
Retains only those files the given iterator yields
In other words, removes all contracts for files not included in the iterator
pub fn merge(&mut self, other: CompilerOutput)
Trait Implementations§
source§impl Clone for CompilerOutput
impl Clone for CompilerOutput
source§fn clone(&self) -> CompilerOutput
fn clone(&self) -> CompilerOutput
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CompilerOutput
impl Debug for CompilerOutput
source§impl Default for CompilerOutput
impl Default for CompilerOutput
source§fn default() -> CompilerOutput
fn default() -> CompilerOutput
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for CompilerOutput
impl<'de> Deserialize<'de> for CompilerOutput
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for CompilerOutput
impl PartialEq for CompilerOutput
source§fn eq(&self, other: &CompilerOutput) -> bool
fn eq(&self, other: &CompilerOutput) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for CompilerOutput
impl Serialize for CompilerOutput
impl StructuralPartialEq for CompilerOutput
Auto Trait Implementations§
impl RefUnwindSafe for CompilerOutput
impl Send for CompilerOutput
impl Sync for CompilerOutput
impl Unpin for CompilerOutput
impl UnwindSafe for CompilerOutput
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
Mutably borrows from an owned value. Read more