Trait ethers_solc::ArtifactOutput [−][src]
pub trait ArtifactOutput {
type Artifact: Artifact + DeserializeOwned;
fn on_output(
output: &CompilerOutput,
layout: &ProjectPathsConfig
) -> Result<()>;
fn contract_to_artifact(
file: &str,
name: &str,
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_artifact(path: impl AsRef<Path>) -> Result<Self::Artifact> { ... }
fn read_cached_artifacts<T, I>(
files: I
) -> Result<BTreeMap<PathBuf, Self::Artifact>>
where
I: IntoIterator<Item = T>,
T: Into<PathBuf>,
{ ... }
fn output_to_artifacts(
output: CompilerOutput
) -> BTreeMap<String, BTreeMap<String, Self::Artifact>> { ... }
}
Associated Types
type Artifact: Artifact + DeserializeOwned
type Artifact: Artifact + DeserializeOwned
How Artifacts are stored
Required methods
fn on_output(output: &CompilerOutput, layout: &ProjectPathsConfig) -> Result<()>
fn on_output(output: &CompilerOutput, layout: &ProjectPathsConfig) -> Result<()>
Handle the compiler output.
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>> 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 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