pub enum SandboxCommand {
Publish {
no_republish: bool,
ignore_breaking_changes: bool,
override_ordering: Option<Vec<String>>,
},
Run {
script_file: PathBuf,
script_name: Option<String>,
signers: Vec<String>,
args: Vec<TransactionArgument>,
type_args: Vec<TypeTag>,
gas_budget: Option<u64>,
dry_run: bool,
},
Test {
use_temp_dir: bool,
track_cov: bool,
},
View {
file: PathBuf,
},
Clean {},
Doctor {},
Generate {
cmd: GenerateCommand,
},
}Variants
Publish
Fields
no_republish: boolIf set, fail when attempting to publish a module that already exists in global storage.
ignore_breaking_changes: boolBy default, code that might cause breaking changes for bytecode linking or data layout compatibility checks will not be published. Set this flag to ignore breaking changes checks and publish anyway.
Compile the modules in this package and its dependencies and publish the resulting bytecodes in global storage.
Run
Fields
script_file: PathBufPath to .mv file containing either script or module bytecodes. If the file is a module, the
script_name parameter must be set.
script_name: Option<String>Name of the script function inside script_file to call. Should only be set if script_file
points to a module.
signers: Vec<String>Possibly-empty list of signers for the current transaction (e.g., account in
main(&account: signer)). Must match the number of signers expected by script_file.
args: Vec<TransactionArgument>Possibly-empty list of arguments passed to the transaction (e.g., i in
main(i: u64)). Must match the arguments types expected by script_file.
Supported argument types are
bool literals (true, false),
u64 literals (e.g., 10, 58),
address literals (e.g., 0x12, 0x0000000000000000000000000000000f),
hexadecimal strings (e.g., x“0012“ will parse as the vector
type_args: Vec<TypeTag>Possibly-empty list of type arguments passed to the transaction (e.g., T in
main<T>()). Must match the type arguments kinds expected by script_file.
gas_budget: Option<u64>Maximum number of gas units to be consumed by execution.
When the budget is exhaused, execution will abort.
By default, no gas-budget is specified and gas metering is disabled.
dry_run: boolIf set, the effects of executing script_file (i.e., published, updated, and
deleted resources) will NOT be committed to disk.
Run a Move script that reads/writes resources stored on disk in storage-dir.
The script must be defined in the package.
Test
Fields
use_temp_dir: boolUse an ephemeral directory to serve as the testing workspace.
By default, the directory containing the args.txt will be the workspace.
track_cov: boolShow coverage information after tests are done. By default, coverage will not be tracked nor shown.
Run expected value tests using the given batch file.
View
Fields
file: PathBufPath to a resource, events file, or module stored on disk.
View Move resources, events files, and modules stored on disk.
Clean
Fields
Delete all resources, events, and modules stored on disk under storage-dir.
Does not delete anything in src.
Doctor
Fields
Run well-formedness checks on the storage-dir and install-dir directories.
Generate
Fields
cmd: GenerateCommandGenerate struct layout bindings for the modules stored on disk under storage-dir
Implementations
sourceimpl SandboxCommand
impl SandboxCommand
pub fn handle_command(
&self,
natives: Vec<(AccountAddress, Identifier, Identifier, NativeFunction)>,
cost_table: &CostTable,
error_descriptions: &ErrorMapping,
move_args: &Move,
storage_dir: &Path
) -> Result<()>
Trait Implementations
sourceimpl CommandFactory for SandboxCommand
impl CommandFactory for SandboxCommand
sourcefn into_app<'b>() -> Command<'b>
fn into_app<'b>() -> Command<'b>
Replaced with `CommandFactory::command
Deprecated, replaced with CommandFactory::command
sourcefn into_app_for_update<'b>() -> Command<'b>
fn into_app_for_update<'b>() -> Command<'b>
Replaced with `CommandFactory::command_for_update
Deprecated, replaced with CommandFactory::command_for_update
sourcefn command_for_update<'help>() -> App<'help>
fn command_for_update<'help>() -> App<'help>
sourceimpl FromArgMatches for SandboxCommand
impl FromArgMatches for SandboxCommand
sourcefn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
sourcefn update_from_arg_matches<'b>(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches<'b>(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
Assign values from ArgMatches to self.
sourceimpl Parser for SandboxCommand
impl Parser for SandboxCommand
sourcefn parse_from<I, T>(itr: I) -> Self where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn parse_from<I, T>(itr: I) -> Self where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Parse from iterator, exit on error
sourcefn try_parse_from<I, T>(itr: I) -> Result<Self, Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Parse from iterator, return Err on error.
sourcefn update_from<I, T>(&mut self, itr: I) where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn update_from<I, T>(&mut self, itr: I) where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Update from iterator, exit on error
sourcefn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Update from iterator, return Err on error.
sourceimpl Subcommand for SandboxCommand
impl Subcommand for SandboxCommand
sourcefn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>
fn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>
sourcefn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>
fn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>
sourcefn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Test whether Self can parse a specific subcommand
Auto Trait Implementations
impl RefUnwindSafe for SandboxCommand
impl Send for SandboxCommand
impl Sync for SandboxCommand
impl Unpin for SandboxCommand
impl UnwindSafe for SandboxCommand
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more