Struct ethers_solc::project::ProjectCompiler
source · pub struct ProjectCompiler<'a, T: ArtifactOutput> { /* private fields */ }
Implementations§
source§impl<'a, T: ArtifactOutput> ProjectCompiler<'a, T>
impl<'a, T: ArtifactOutput> ProjectCompiler<'a, T>
sourcepub fn with_sources_and_solc(
project: &'a Project<T>,
sources: Sources,
solc: Solc
) -> Result<Self>
pub fn with_sources_and_solc(
project: &'a Project<T>,
sources: Sources,
solc: Solc
) -> Result<Self>
Compiles the sources with a pinned Solc
instance
sourcepub fn with_sparse_output(
self,
sparse_output: impl Into<SparseOutputFilter>
) -> Self
pub fn with_sparse_output(
self,
sparse_output: impl Into<SparseOutputFilter>
) -> Self
Applies the specified filter to be applied when selecting solc output for specific files to be compiled
sourcepub fn compile(self) -> Result<ProjectCompileOutput<T>>
pub fn compile(self) -> Result<ProjectCompileOutput<T>>
Compiles all the sources of the Project
in the appropriate mode
If caching is enabled, the sources are filtered and only dirty sources are recompiled.
The output of the compile process can be a mix of reused artifacts and freshly compiled
Contract
s
Example
use ethers_solc::Project;
let project = Project::builder().build().unwrap();
let output = project.compile().unwrap();