Trait ethers::solc::ArtifactOutput [−][src]
pub trait ArtifactOutput {
type Artifact: Artifact;
fn on_output(
output: &CompilerOutput,
layout: &ProjectPathsConfig
) -> Result<(), SolcError>;
fn read_cached_artifact(
path: impl AsRef<Path>
) -> Result<Self::Artifact, SolcError>;
fn contract_to_artifact(contract: Contract) -> Self::Artifact;
fn output_file_name(name: impl AsRef<str>) -> PathBuf { ... }
fn output_file(
contract_file: impl AsRef<Path>,
name: impl AsRef<str>
) -> PathBuf { ... }
fn contract_name(file: impl AsRef<Path>) -> Option<String> { ... }
fn output_exists(
contract_file: impl AsRef<Path>,
name: impl AsRef<str>,
root: impl AsRef<Path>
) -> bool { ... }
fn read_cached_artifacts<T, I>(
files: I
) -> Result<BTreeMap<PathBuf, Self::Artifact>, SolcError>
where
I: IntoIterator<Item = T>,
T: Into<PathBuf>,
{ ... }
fn output_to_artifacts(
output: CompilerOutput
) -> BTreeMap<String, BTreeMap<String, Self::Artifact>> { ... }
}
Associated Types
Required methods
fn on_output(
output: &CompilerOutput,
layout: &ProjectPathsConfig
) -> Result<(), SolcError>
fn on_output(
output: &CompilerOutput,
layout: &ProjectPathsConfig
) -> Result<(), SolcError>
Handle the compiler output.
fn contract_to_artifact(contract: Contract) -> Self::Artifact
fn contract_to_artifact(contract: Contract) -> Self::Artifact
Convert a contract to the artifact type
Provided methods
fn 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
Returns the path to the contract’s artifact location based on the contract’s file and name
This returns contract.sol/contract.json
by default
The inverse of contract_file_name
Expected to return the solidity contract’s name derived from the file path
sources/Greeter.sol
-> Greeter
Whether the corresponding artifact of the given contract file and name exists
fn read_cached_artifacts<T, I>(
files: I
) -> Result<BTreeMap<PathBuf, Self::Artifact>, SolcError> where
I: IntoIterator<Item = T>,
T: Into<PathBuf>,
fn read_cached_artifacts<T, I>(
files: I
) -> Result<BTreeMap<PathBuf, Self::Artifact>, SolcError> where
I: IntoIterator<Item = T>,
T: Into<PathBuf>,
Read the cached artifacts from disk
fn output_to_artifacts(
output: CompilerOutput
) -> BTreeMap<String, BTreeMap<String, Self::Artifact>>
fn output_to_artifacts(
output: CompilerOutput
) -> BTreeMap<String, BTreeMap<String, Self::Artifact>>
Convert the compiler output into a set of artifacts