pub enum Argument {
Gas,
Input(u16),
Result(u16),
NestedResult(u16, u16),
}Expand description
An argument to a programmable transaction command
§BCS
The BCS serialized form for this type is defined by the following ABNF:
argument = argument-gas
=/ argument-input
=/ argument-result
=/ argument-nested-result
argument-gas = %x00
argument-input = %x01 u16
argument-result = %x02 u16
argument-nested-result = %x03 u16 u16Variants§
Gas
The gas coin. The gas coin can only be used by-ref, except for with
TransferObjects, which can use it by-value.
Input(u16)
One of the input objects or primitive values (from
ProgrammableTransaction inputs)
Result(u16)
The result of another command (from ProgrammableTransaction commands)
NestedResult(u16, u16)
Like a Result but it accesses a nested result. Currently, the only
usage of this is to access a value from a Move call with multiple
return values.
Implementations§
Source§impl Argument
impl Argument
pub fn is_gas(&self) -> bool
pub fn is_input(&self) -> bool
pub fn is_result(&self) -> bool
pub fn is_nested_result(&self) -> bool
pub fn as_input_opt(&self) -> Option<u16>
pub fn as_input(&self) -> u16
pub fn as_result_opt(&self) -> Option<u16>
pub fn as_result(&self) -> u16
pub fn as_nested_result_opt(&self) -> Option<(u16, u16)>
pub fn as_nested_result(&self) -> (u16, u16)
Sourcepub fn get_nested_result(&self, ix: u16) -> Option<Argument>
pub fn get_nested_result(&self, ix: u16) -> Option<Argument>
Get the nested result for this result at the given index. Returns None if this is not a Result.
Trait Implementations§
Source§impl Arbitrary for Argument
impl Arbitrary for Argument
Source§type Parameters = ()
type Parameters = ()
The type of parameters that
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.Source§type Strategy = BoxedStrategy<Argument>
type Strategy = BoxedStrategy<Argument>
The type of
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 Argument
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Argument
Available on crate feature
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Argument
Available on crate feature serde only.
impl JsonSchema for Argument
Available on crate feature
serde only.Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreimpl Copy for Argument
impl Eq for Argument
impl StructuralPartialEq for Argument
Auto Trait Implementations§
impl Freeze for Argument
impl RefUnwindSafe for Argument
impl Send for Argument
impl Sync for Argument
impl Unpin for Argument
impl UnwindSafe for Argument
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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