Struct ethcontract_generate::Artifact[][src]

pub struct Artifact { /* fields omitted */ }
Expand description

An entity that contains compiled contracts.

Implementations

Creates a new empty artifact.

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.

Gets number of contracts contained in this artifact.

Returns true if this artifact contains no contracts.

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.

Takes all contracts from the artifact, leaving it empty, and returns an iterator over the taken contracts.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.