CommandArgumentError

Enum CommandArgumentError 

Source
#[non_exhaustive]
pub enum CommandArgumentError {
Show 19 variants TypeMismatch, InvalidBcsBytes, InvalidUsageOfPureArgument, InvalidArgumentToPrivateEntryFunction, IndexOutOfBounds { index: u16, }, SecondaryIndexOutOfBounds { result: u16, subresult: u16, }, InvalidResultArity { result: u16, }, InvalidGasCoinUsage, InvalidValueUsage, InvalidObjectByValue, InvalidObjectByMutRef, ConsensusObjectOperationNotAllowed, InvalidArgumentArity, InvalidTransferObject, InvalidMakeMoveVecNonObjectArgument, ArgumentWithoutValue, CannotMoveBorrowedValue, CannotWriteToExtendedReference, InvalidReferenceArgument,
}
Expand description

An error with an argument to a command

§BCS

The BCS serialized form for this type is defined by the following ABNF:

command-argument-error =  type-mismatch
                       =/ invalid-bcs-bytes
                       =/ invalid-usage-of-pure-argument
                       =/ invalid-argument-to-private-entry-function
                       =/ index-out-of-bounds
                       =/ secondary-index-out-of-bound
                       =/ invalid-result-arity
                       =/ invalid-gas-coin-usage
                       =/ invalid-value-usage
                       =/ invalid-object-by-value
                       =/ invalid-object-by-mut-ref
                       =/ consensus-object-operation-not-allowed

type-mismatch                               = %x00
invalid-bcs-bytes                           = %x01
invalid-usage-of-pure-argument              = %x02
invalid-argument-to-private-entry-function  = %x03
index-out-of-bounds                         = %x04 u16
secondary-index-out-of-bound                = %x05 u16 u16
invalid-result-arity                        = %x06 u16
invalid-gas-coin-usage                      = %x07
invalid-value-usage                         = %x08
invalid-object-by-value                     = %x09
invalid-object-by-mut-ref                   = %x0a
consensus-object-operation-not-allowed         = %x0b

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

TypeMismatch

The type of the value does not match the expected type

§

InvalidBcsBytes

The argument cannot be deserialized into a value of the specified type

§

InvalidUsageOfPureArgument

The argument cannot be instantiated from raw bytes

§

InvalidArgumentToPrivateEntryFunction

Invalid argument to private entry function. Private entry functions cannot take arguments from other Move functions.

§

IndexOutOfBounds

Out of bounds access to input or results

Fields

§index: u16
§

SecondaryIndexOutOfBounds

Out of bounds access to subresult

Fields

§result: u16
§subresult: u16
§

InvalidResultArity

Invalid usage of result. Expected a single result but found either no return value or multiple.

Fields

§result: u16
§

InvalidGasCoinUsage

Invalid usage of Gas coin. The Gas coin can only be used by-value with a TransferObjects command.

§

InvalidValueUsage

Invalid usage of move value.

§

InvalidObjectByValue

Immutable objects cannot be passed by-value.

§

InvalidObjectByMutRef

Immutable objects cannot be passed by mutable reference, &mut.

§

ConsensusObjectOperationNotAllowed

consensus object operations such a wrapping, freezing, or converting to owned are not allowed.

§

InvalidArgumentArity

Invalid argument arity. Expected a single argument but found a result that expanded to multiple arguments.

§

InvalidTransferObject

Object passed to TransferObject does not have public transfer, i.e. the store ability

§

InvalidMakeMoveVecNonObjectArgument

First argument to MakeMoveVec is not an object. If no type is specified for MakeMoveVec, all arguments must be the same object type.

§

ArgumentWithoutValue

Specified argument location does not have a value and cannot be used

§

CannotMoveBorrowedValue

Cannot move a borrowed value. The value’s type does resulted in this argument usage being inferred as a move. This is likely due to the type not having the copy ability; although in rare cases, it could also be this is the last usage of a value without the drop ability.

§

CannotWriteToExtendedReference

Cannot write to an argument location that is still borrowed, and where that borrow is an extension of that reference. This is likely due to this argument being used in a Move call that returns a reference, and that reference is used in a later command.

§

InvalidReferenceArgument

The argument specified cannot be used as a reference argument in the Move call. Either the argument is a mutable reference and it conflicts with another argument to the call, or the argument is mutable and another reference extends it and will be used in a later command.

Trait Implementations§

Source§

impl Arbitrary for CommandArgumentError

Source§

type Parameters = ()

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default.
Source§

type Strategy = BoxedStrategy<CommandArgumentError>

The type of Strategy used to generate values of type Self.
Source§

fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more
§

fn arbitrary() -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more
Source§

impl Clone for CommandArgumentError

Source§

fn clone(&self) -> CommandArgumentError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CommandArgumentError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CommandArgumentError

Source§

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 PartialEq for CommandArgumentError

Source§

fn eq(&self, other: &CommandArgumentError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CommandArgumentError

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for CommandArgumentError

Source§

impl StructuralPartialEq for CommandArgumentError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<U> As for U

§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'de, T> FromBcs for T
where T: Deserialize<'de>,

Source§

fn from_bcs<'de>(bytes: &'de [u8]) -> Result<Self, Error>
where Self: Deserialize<'de>,

Available on crate feature serde only.
Source§

fn from_bcs_base64(base64: &str) -> Result<Self, Error>
where Self: DeserializeOwned,

Available on crate feature serde only.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToBcs for T
where T: Serialize,

Source§

fn to_bcs(&self) -> Result<Vec<u8>, Error>

Available on crate feature serde only.
Source§

fn to_bcs_base64(&self) -> Result<String, Error>

Available on crate feature serde only.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,