pub enum Command {
MoveCall(MoveCall),
TransferObjects(TransferObjects),
SplitCoins(SplitCoins),
MergeCoins(MergeCoins),
Publish(Publish),
MakeMoveVector(MakeMoveVector),
Upgrade(Upgrade),
}Expand description
A single command in a programmable transaction.
§BCS
The BCS serialized form for this type is defined by the following ABNF:
command = command-move-call
=/ command-transfer-objects
=/ command-split-coins
=/ command-merge-coins
=/ command-publish
=/ command-make-move-vector
=/ command-upgrade
command-move-call = %x00 move-call
command-transfer-objects = %x01 transfer-objects
command-split-coins = %x02 split-coins
command-merge-coins = %x03 merge-coins
command-publish = %x04 publish
command-make-move-vector = %x05 make-move-vector
command-upgrade = %x06 upgradeVariants§
MoveCall(MoveCall)
A call to either an entry or a public Move function
TransferObjects(TransferObjects)
(Vec<forall T:key+store. T>, address)
It sends n-objects to the specified address. These objects must have
store (public transfer) and either the previous owner must be an
address or the object must be newly created.
SplitCoins(SplitCoins)
(&mut Coin<T>, Vec<u64>) -> Vec<Coin<T>>
It splits off some amounts into a new coins with those amounts
MergeCoins(MergeCoins)
(&mut Coin<T>, Vec<Coin<T>>)
It merges n-coins into the first coin
Publish(Publish)
Publishes a Move package. It takes the package bytes and a list of the package’s transitive dependencies to link against on-chain.
MakeMoveVector(MakeMoveVector)
forall T: Vec<T> -> vector<T>
Given n-values of the same type, it constructs a vector. For non objects
or an empty vector, the type tag must be specified.
Upgrade(Upgrade)
Upgrades a Move package Takes (in order):
- A vector of serialized modules for the package.
- A vector of object ids for the transitive dependencies of the new package.
- The object ID of the package being upgraded.
- An argument holding the
UpgradeTicketthat must have been produced from an earlier command in the same programmable transaction.
Implementations§
Source§impl Command
impl Command
pub fn is_move_call(&self) -> bool
pub fn as_move_call(&self) -> &MoveCall
pub fn as_move_call_opt(&self) -> Option<&MoveCall>
pub fn into_move_call_opt(self) -> Option<MoveCall>
pub fn into_move_call(self) -> MoveCall
pub fn is_transfer_objects(&self) -> bool
pub fn as_transfer_objects(&self) -> &TransferObjects
pub fn as_transfer_objects_opt(&self) -> Option<&TransferObjects>
pub fn into_transfer_objects_opt(self) -> Option<TransferObjects>
pub fn into_transfer_objects(self) -> TransferObjects
pub fn is_split_coins(&self) -> bool
pub fn as_split_coins(&self) -> &SplitCoins
pub fn as_split_coins_opt(&self) -> Option<&SplitCoins>
pub fn into_split_coins_opt(self) -> Option<SplitCoins>
pub fn into_split_coins(self) -> SplitCoins
pub fn is_merge_coins(&self) -> bool
pub fn as_merge_coins(&self) -> &MergeCoins
pub fn as_merge_coins_opt(&self) -> Option<&MergeCoins>
pub fn into_merge_coins_opt(self) -> Option<MergeCoins>
pub fn into_merge_coins(self) -> MergeCoins
pub fn is_publish(&self) -> bool
pub fn as_publish(&self) -> &Publish
pub fn as_publish_opt(&self) -> Option<&Publish>
pub fn into_publish_opt(self) -> Option<Publish>
pub fn into_publish(self) -> Publish
pub fn is_make_move_vector(&self) -> bool
pub fn as_make_move_vector(&self) -> &MakeMoveVector
pub fn as_make_move_vector_opt(&self) -> Option<&MakeMoveVector>
pub fn into_make_move_vector_opt(self) -> Option<MakeMoveVector>
pub fn into_make_move_vector(self) -> MakeMoveVector
pub fn is_upgrade(&self) -> bool
pub fn as_upgrade(&self) -> &Upgrade
pub fn as_upgrade_opt(&self) -> Option<&Upgrade>
pub fn into_upgrade_opt(self) -> Option<Upgrade>
pub fn into_upgrade(self) -> Upgrade
Trait Implementations§
Source§impl Arbitrary for Command
impl Arbitrary for Command
Source§type Parameters = ()
type Parameters = ()
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.Source§type Strategy = BoxedStrategy<Command>
type Strategy = BoxedStrategy<Command>
Strategy used to generate values of type Self.Source§fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
Source§impl<'de> Deserialize<'de> for Command
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Command
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl JsonSchema for Command
impl JsonSchema for Command
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreimpl Eq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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