Struct ethers_solc::ConfigurableArtifacts
source · pub struct ConfigurableArtifacts {
pub additional_values: ExtraOutputValues,
pub additional_files: ExtraOutputFiles,
/* private fields */
}Expand description
An Artifact implementation that can be configured to include additional content and emit
additional files
Creates a single json artifact with
{
"abi": [],
"bytecode": {...},
"deployedBytecode": {...},
"methodIdentifiers": {...},
// additional values
}Fields
additional_values: ExtraOutputValuesA set of additional values to include in the contract’s artifact file
additional_files: ExtraOutputFilesA set of values that should be written to a separate file
Implementations
sourceimpl ConfigurableArtifacts
impl ConfigurableArtifacts
pub fn new(
extra_values: impl IntoIterator<Item = ContractOutputSelection>,
extra_files: impl IntoIterator<Item = ContractOutputSelection>
) -> Self
sourcepub fn output_selection(&self) -> Vec<ContractOutputSelection> ⓘ
pub fn output_selection(&self) -> Vec<ContractOutputSelection> ⓘ
Returns the output selection corresponding to this configuration
Trait Implementations
sourceimpl ArtifactOutput for ConfigurableArtifacts
impl ArtifactOutput for ConfigurableArtifacts
type Artifact = ConfigurableContractArtifact
type Artifact = ConfigurableContractArtifact
Represents the artifact that will be stored for a
Contractsourcefn write_contract_extras(
&self,
contract: &Contract,
file: &Path
) -> Result<(), SolcError>
fn write_contract_extras(
&self,
contract: &Contract,
file: &Path
) -> Result<(), SolcError>
Write additional files for the contract
sourcefn contract_to_artifact(
&self,
_file: &str,
_name: &str,
contract: Contract,
source_file: Option<&SourceFile>
) -> Self::Artifact
fn contract_to_artifact(
&self,
_file: &str,
_name: &str,
contract: Contract,
source_file: Option<&SourceFile>
) -> Self::Artifact
Convert a contract to the artifact type Read more
sourcefn standalone_source_file_to_artifact(
&self,
_path: &str,
file: &VersionedSourceFile
) -> Option<Self::Artifact>
fn standalone_source_file_to_artifact(
&self,
_path: &str,
file: &VersionedSourceFile
) -> Option<Self::Artifact>
This converts a
SourceFile that doesn’t contain any contract definitions (interfaces,
contracts, libraries) to an artifact. Read moresourcefn on_output(
&self,
contracts: &VersionedContracts,
sources: &VersionedSourceFiles,
layout: &ProjectPathsConfig,
ctx: OutputContext<'_>
) -> Result<Artifacts<Self::Artifact>>
fn on_output(
&self,
contracts: &VersionedContracts,
sources: &VersionedSourceFiles,
layout: &ProjectPathsConfig,
ctx: OutputContext<'_>
) -> Result<Artifacts<Self::Artifact>>
Handle the aggregated set of compiled contracts from the solc
crate::CompilerOutput. Read moresourcefn write_extras(
&self,
contracts: &VersionedContracts,
artifacts: &Artifacts<Self::Artifact>
) -> Result<()>
fn write_extras(
&self,
contracts: &VersionedContracts,
artifacts: &Artifacts<Self::Artifact>
) -> Result<()>
Writes additional files for the contracts if the included in the
Contract, such as ir,
ewasm, iropt. Read moresourcefn output_file_name(name: impl AsRef<str>) -> PathBuf
fn output_file_name(name: impl AsRef<str>) -> PathBuf
Returns the file name for the contract’s artifact
Greeter.json Read moresourcefn output_file_name_versioned(
name: impl AsRef<str>,
version: &Version
) -> PathBuf
fn output_file_name_versioned(
name: impl AsRef<str>,
version: &Version
) -> PathBuf
Returns the file name for the contract’s artifact and the given version
Greeter.0.8.11.json Read moresourcefn conflict_free_output_file(
already_taken: &HashSet<PathBuf>,
conflict: PathBuf,
contract_file: impl AsRef<Path>,
artifacts_folder: impl AsRef<Path>
) -> PathBuf
fn conflict_free_output_file(
already_taken: &HashSet<PathBuf>,
conflict: PathBuf,
contract_file: impl AsRef<Path>,
artifacts_folder: impl AsRef<Path>
) -> PathBuf
Returns the appropriate file name for the conflicting file. Read more
sourcefn output_file(contract_file: impl AsRef<Path>, name: impl AsRef<str>) -> PathBuf
fn output_file(contract_file: impl AsRef<Path>, name: impl AsRef<str>) -> PathBuf
Returns the path to the contract’s artifact location based on the contract’s file and name Read more
sourcefn output_file_versioned(
contract_file: impl AsRef<Path>,
name: impl AsRef<str>,
version: &Version
) -> PathBuf
fn output_file_versioned(
contract_file: impl AsRef<Path>,
name: impl AsRef<str>,
version: &Version
) -> PathBuf
Returns the path to the contract’s artifact location based on the contract’s file, name and
version Read more
sourcefn contract_name(file: impl AsRef<Path>) -> Option<String>
fn contract_name(file: impl AsRef<Path>) -> Option<String>
The inverse of
contract_file_name Read moresourcefn output_exists(
contract_file: impl AsRef<Path>,
name: impl AsRef<str>,
root: impl AsRef<Path>
) -> bool
fn output_exists(
contract_file: impl AsRef<Path>,
name: impl AsRef<str>,
root: impl AsRef<Path>
) -> bool
Whether the corresponding artifact of the given contract file and name exists
sourcefn read_cached_artifact(path: impl AsRef<Path>) -> Result<Self::Artifact>
fn read_cached_artifact(path: impl AsRef<Path>) -> Result<Self::Artifact>
Read the artifact that’s stored at the given path Read more
sourcefn read_cached_artifacts<T, I>(
files: I
) -> Result<BTreeMap<PathBuf, Self::Artifact>>where
I: IntoIterator<Item = T>,
T: Into<PathBuf>,
fn read_cached_artifacts<T, I>(
files: I
) -> Result<BTreeMap<PathBuf, Self::Artifact>>where
I: IntoIterator<Item = T>,
T: Into<PathBuf>,
Read the cached artifacts that are located the paths the iterator yields Read more
sourcefn output_to_artifacts(
&self,
contracts: &VersionedContracts,
sources: &VersionedSourceFiles,
ctx: OutputContext<'_>,
layout: &ProjectPathsConfig
) -> Artifacts<Self::Artifact>
fn output_to_artifacts(
&self,
contracts: &VersionedContracts,
sources: &VersionedSourceFiles,
ctx: OutputContext<'_>,
layout: &ProjectPathsConfig
) -> Artifacts<Self::Artifact>
Convert the compiler output into a set of artifacts Read more
sourceimpl Clone for ConfigurableArtifacts
impl Clone for ConfigurableArtifacts
sourcefn clone(&self) -> ConfigurableArtifacts
fn clone(&self) -> ConfigurableArtifacts
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 moresourceimpl Debug for ConfigurableArtifacts
impl Debug for ConfigurableArtifacts
sourceimpl Default for ConfigurableArtifacts
impl Default for ConfigurableArtifacts
sourcefn default() -> ConfigurableArtifacts
fn default() -> ConfigurableArtifacts
Returns the “default value” for a type. Read more
sourceimpl PartialEq<ConfigurableArtifacts> for ConfigurableArtifacts
impl PartialEq<ConfigurableArtifacts> for ConfigurableArtifacts
sourcefn eq(&self, other: &ConfigurableArtifacts) -> bool
fn eq(&self, other: &ConfigurableArtifacts) -> bool
impl Copy for ConfigurableArtifacts
impl Eq for ConfigurableArtifacts
impl StructuralEq for ConfigurableArtifacts
impl StructuralPartialEq for ConfigurableArtifacts
Auto Trait Implementations
impl RefUnwindSafe for ConfigurableArtifacts
impl Send for ConfigurableArtifacts
impl Sync for ConfigurableArtifacts
impl Unpin for ConfigurableArtifacts
impl UnwindSafe for ConfigurableArtifacts
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.