Struct foundry_compilers::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 only.
pub fn new(project: &'a Project<T>) -> Result<Self>
svm-solc only.Create a new ProjectCompiler to bootstrap the compilation process of the project’s
sources.
sourcepub fn with_sources(project: &'a Project<T>, sources: Sources) -> Result<Self>
Available on crate feature svm-solc only.
pub fn with_sources(project: &'a Project<T>, sources: Sources) -> Result<Self>
svm-solc 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
Contracts
§Examples
use foundry_compilers::Project;
let project = Project::builder().build()?;
let output = project.compile()?;Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for ProjectCompiler<'a, T>
impl<'a, T> !RefUnwindSafe for ProjectCompiler<'a, T>
impl<'a, T> !Send for ProjectCompiler<'a, T>
impl<'a, T> !Sync for ProjectCompiler<'a, T>
impl<'a, T> Unpin for ProjectCompiler<'a, T>
impl<'a, T> !UnwindSafe for ProjectCompiler<'a, T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more