nexus_sdk::compile

Trait Compile

Source
pub trait Compile {
    // Required methods
    fn new(package: &str) -> Self;
    fn new_with_custom_binary(package: &str, binary: &str) -> Self;
    fn set_debug_build(&mut self, debug: bool);
    fn set_native_build(&mut self, native: bool);
    fn set_unique_build(&mut self, unique: bool);
    fn build(&mut self) -> Result<PathBuf, BuildError>;

    // Provided method
    fn set_linker() -> Result<PathBuf, BuildError> { ... }
}
Expand description

An interface for dynamic compilation of guest programs.

Required Methods§

Source

fn new(package: &str) -> Self

Setup dynamic compilation.

Source

fn new_with_custom_binary(package: &str, binary: &str) -> Self

Setup dynamic compilation, using non-default binary name.

Source

fn set_debug_build(&mut self, debug: bool)

Set dynamic compilation to build the guest program in a debug profile.

Source

fn set_native_build(&mut self, native: bool)

Set dynamic compilation to build for the native (host machine) target, rather than for the zkVM.

Source

fn set_unique_build(&mut self, unique: bool)

Set dynamic compilation to run a unique build that neither overwrites prior builds nor will be overwritten by future builds. May be used to concurrently build different versions of the same binary.

Note: the SDK does not automatically clean or otherwise manage the resultant builds in the output directory.

Source

fn build(&mut self) -> Result<PathBuf, BuildError>

Compile and build the guest binary.

Provided Methods§

Source

fn set_linker() -> Result<PathBuf, BuildError>

Set the linker script to use when building the guest binary.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§