pub struct ScryptoCompiler { /* private fields */ }
Expand description
Programmatic implementation of Scrypto compiler which is a wrapper around rust cargo tool.
To create an instance of ScryptoCompiler
use builder()
constructor which implements builder pattern,
provide any required parameter @see ScryptoCompilerInputParams
and finally call compile()
function.
ScryptoCompiler
supports worspace compilation by providing workspace manifest as manifest_path
parameter of
running compiler from directory containg workspace Cargo.toml file. Only packages with defined metadata group:
[package.metadata.scrypto] will be used during workspace compilation (so workspace manifest can contain also non
Scrypto packages). Alternativelly packages for workspace compilation can be provided in package
input parameter,
metadata is not validated in that case.
Compilation results consists of list of BuildArtifacts
which contains generated WASM file path and its content
and path to RPD file with package definition and PackageDefinition
struct.
Implementations§
Source§impl ScryptoCompiler
impl ScryptoCompiler
pub fn builder() -> ScryptoCompilerBuilder
pub fn compile_with_stdio<T: Into<Stdio>>( &mut self, stdin: Option<T>, stdout: Option<T>, stderr: Option<T>, ) -> Result<Vec<BuildArtifacts>, ScryptoCompilerError>
pub fn compile(&mut self) -> Result<Vec<BuildArtifacts>, ScryptoCompilerError>
Sourcepub fn get_main_manifest_definition(&self) -> CompilerManifestDefinition
pub fn get_main_manifest_definition(&self) -> CompilerManifestDefinition
Returns information about the main manifest
Auto Trait Implementations§
impl Freeze for ScryptoCompiler
impl RefUnwindSafe for ScryptoCompiler
impl Send for ScryptoCompiler
impl Sync for ScryptoCompiler
impl Unpin for ScryptoCompiler
impl UnwindSafe for ScryptoCompiler
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, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
type Error = <U as ContextualTryFrom<T>>::Error
type Context = <U as ContextualTryFrom<T>>::Context
fn contextual_try_into( self, context: &<U as ContextualTryFrom<T>>::Context, ) -> Result<U, <U as ContextualTryFrom<T>>::Error>
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.