Struct ethcontract_generate::Artifact [−][src]
pub struct Artifact { /* fields omitted */ }
Expand description
An entity that contains compiled contracts.
Implementations
Creates a new artifact with an origin information.
Provides description of where this artifact comes from.
This function is used when a human-readable reference to the artifact is required. It could be anything: path to a json file, url, etc.
Sets new origin for the artifact.
Artifact loaders will set origin to something meaningful in most cases, so this function should not be used often. There are cases when it is required, though.
Returns true
if this artifact has a contract with the given name.
Looks up contract by its name and returns a reference to it.
Some artifact formats allow exporting a single unnamed contract. In this case, the contract will have an empty string as its name.
Looks up contract by its name and returns a handle that allows safely mutating it.
The returned handle does not allow renaming contract. For that, you’ll need to remove it and add again.
Inserts a new contract to the artifact.
If contract with this name already exists, replaces it and returns the old contract.
Removes contract from the artifact.
Returns removed contract or None
if contract with the given name
wasn’t found.
Creates an iterator that yields the artifact’s contracts.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Artifact
impl UnwindSafe for Artifact