pub struct Builder<'a> { /* private fields */ }Implementations§
Source§impl<'a> Builder<'a>
impl<'a> Builder<'a>
Sourcepub const fn with_implicit_iota_imports(self) -> Self
pub const fn with_implicit_iota_imports(self) -> Self
Add iota implicit imports as explicit use statements to the module.
Adapted from the sui equivalents.
Sourcepub const fn with_implicit_sui_imports(self) -> Self
pub const fn with_implicit_sui_imports(self) -> Self
Add sui implicit imports as explicit use statements to the module.
This is done after reading the Move files and before generating the Rust code. Without this,
datatypes with field types like UID which aren’t explicitly imported in Move modules will
fail to compile because they will not have the full path to the Rust equivalent.
Sourcepub fn moverox_path(self, rust_path: &str) -> Self
pub fn moverox_path(self, rust_path: &str) -> Self
Path to the module containing the necessary exports that the generated code needs.
Defaults to ::moverox.
rust_path must point to a crate/module which exports:
- a
typesmodule withAddressandU256types frommoverox-types - a
traitsmodule withHasKey,MoveDatatypeandMoveTypetraits frommoverox-traits - the
serdecrate
Sourcepub fn map_address(self, named_address: &str, rust_path: &str) -> Self
pub fn map_address(self, named_address: &str, rust_path: &str) -> Self
Map a Move named address to the path of an oxidized Move package.
This is necessary for Move code that depends on other packages. The idea is to ‘oxidize’ those dependency packages first and them substitute their paths for the Move paths in the source code this builder is processing.
§Panics
If named_address is not a valid identifier
pub const fn published_at(self, hex_address: &'a str) -> Self
Sourcepub const fn emit_rerun_if_changed(self, enable: bool) -> Self
pub const fn emit_rerun_if_changed(self, enable: bool) -> Self
Enable or disable emitting
cargo:rerun-if-changed=PATH
instructions for Cargo.
If set, writes instructions to stdout for Cargo so that it understands
when to rerun the build script. By default, this setting is enabled if
the CARGO environment variable is set. The CARGO environment
variable is set by Cargo for build scripts. Therefore, this setting
should be enabled automatically when run from a build script. However,
the method of detection is not completely reliable since the CARGO
environment variable can have been set by anything else. If writing the
instructions to stdout is undesirable, you can disable this setting
explicitly.
Sourcepub fn out_dir(self, path: impl Into<PathBuf>) -> Self
pub fn out_dir(self, path: impl Into<PathBuf>) -> Self
Configures the output directory where generated Rust files will be written.
If unset, defaults to the OUT_DIR environment variable. OUT_DIR is set by Cargo when
executing build scripts, so out_dir typically does not need to be configured.