pub enum ReturnCode {
Show 15 variants
Success = 0,
FunctionNotFound = 1,
FunctionWrongSignature = 2,
ContractNotFound = 3,
UserError = 4,
OutOfGas = 5,
AccountCollision = 6,
OutOfFunds = 7,
CallStackOverFlow = 8,
ContractInvalid = 9,
ExecutionFailed = 10,
UpgradeFailed = 11,
SimulateFailed = 12,
DebugApiError = 100,
NetworkTimeout = 101,
}
Variants§
Success = 0
Returned when execution was completed normally.
FunctionNotFound = 1
Returned when the input specifies a function name that does not exist or is not public.
FunctionWrongSignature = 2
Returned when the wrong number of arguments is provided.
ContractNotFound = 3
Returned when the called contract does not exist.
UserError = 4
Returned for various execution errors.
OutOfGas = 5
Returned when VM execution runs out of gas.
AccountCollision = 6
Returned when created account already exists.
OutOfFunds = 7
Returned when the caller (sender) runs out of funds.
CallStackOverFlow = 8
Returned when stack overflow occurs.
ContractInvalid = 9
Returned when the contract is invalid.
ExecutionFailed = 10
Returned when the execution of the specified function has failed.
UpgradeFailed = 11
Returned when the upgrade of the contract has failed
SimulateFailed = 12
Returned when tx simulation fails execution
DebugApiError = 100
Only occurs in the debugger context.
NetworkTimeout = 101
Implementations§
Source§impl ReturnCode
impl ReturnCode
pub fn as_u64(self) -> u64
pub fn is_success(self) -> bool
pub fn message(self) -> &'static str
pub fn from_u64(value: u64) -> Option<ReturnCode>
pub fn from_message(message: &str) -> Option<ReturnCode>
Trait Implementations§
Source§impl Clone for ReturnCode
impl Clone for ReturnCode
Source§fn clone(&self) -> ReturnCode
fn clone(&self) -> ReturnCode
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ReturnCode
impl Debug for ReturnCode
Source§impl Default for ReturnCode
impl Default for ReturnCode
Source§fn default() -> ReturnCode
fn default() -> ReturnCode
Returns the “default value” for a type. Read more
Source§impl Display for ReturnCode
impl Display for ReturnCode
Source§impl From<ReturnCode> for U64Value
impl From<ReturnCode> for U64Value
Source§fn from(from: ReturnCode) -> Self
fn from(from: ReturnCode) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ReturnCode
impl PartialEq for ReturnCode
impl Copy for ReturnCode
impl Eq for ReturnCode
impl StructuralPartialEq for ReturnCode
Auto Trait Implementations§
impl Freeze for ReturnCode
impl RefUnwindSafe for ReturnCode
impl Send for ReturnCode
impl Sync for ReturnCode
impl Unpin for ReturnCode
impl UnwindSafe for ReturnCode
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> InterpretableFrom<&T> for Twhere
T: Clone,
impl<T> InterpretableFrom<&T> for Twhere
T: Clone,
fn interpret_from(from: &T, _context: &InterpreterContext) -> T
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
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