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 new(project: &'a Project<T>) -> Result<Self>
Available on crate feature svm-solc
and non-WebAssembly only.
pub fn new(project: &'a Project<T>) -> Result<Self>
svm-solc
and non-WebAssembly only.Create a new ProjectCompiler
to bootstrap the compilation process of the project’s
sources.
§Example
use ethers_solc::Project;
let project = Project::builder().build().unwrap();
let output = project.compile().unwrap();
sourcepub fn with_sources(project: &'a Project<T>, sources: Sources) -> Result<Self>
Available on crate feature svm-solc
and non-WebAssembly only.
pub fn with_sources(project: &'a Project<T>, sources: Sources) -> Result<Self>
svm-solc
and non-WebAssembly only.Bootstraps the compilation process by resolving the dependency graph of all sources and the
appropriate Solc
-> Sources
set as well as the compile mode to use (parallel,
sequential)
Multiple (Solc
-> Sources
) pairs can be compiled in parallel if the Project
allows
multiple jobs
, see crate::Project::set_solc_jobs()
.
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();