Struct ExitCode

Source
pub struct ExitCode { /* private fields */ }
Expand description

ExitCode defines the exit code from the VM invocation.

Implementations§

Source§

impl ExitCode

Source

pub const fn new(value: u32) -> Self

Source

pub fn value(self) -> u32

Source

pub fn is_success(self) -> bool

Returns true if the exit code indicates success.

Source

pub fn is_system_error(self) -> bool

Returns true if the error code is in the range of exit codes reserved for the VM (including Ok).

Source§

impl ExitCode

Source

pub const OK: ExitCode

The code indicating successful execution.

Source

pub const SYS_SENDER_INVALID: ExitCode

The message sender doesn’t exist.

Source

pub const SYS_SENDER_STATE_INVALID: ExitCode

The message sender was not in a valid state to send this message.

Either:

  • The sender’s nonce nonce didn’t match the message nonce.
  • The sender didn’t have the funds to cover the message gas.
Source

pub const SYS_ILLEGAL_INSTRUCTION: ExitCode

The message receiver trapped (panicked).

Source

pub const SYS_INVALID_RECEIVER: ExitCode

The message receiver doesn’t exist and can’t be automatically created

Source

pub const SYS_INSUFFICIENT_FUNDS: ExitCode

The message sender didn’t have the requisite funds.

Source

pub const SYS_OUT_OF_GAS: ExitCode

Message execution (including subcalls) used more gas than the specified limit.

Source

pub const SYS_ILLEGAL_EXIT_CODE: ExitCode

The message receiver aborted with a reserved exit code.

Source

pub const SYS_ASSERTION_FAILED: ExitCode

An internal VM assertion failed.

Source

pub const SYS_MISSING_RETURN: ExitCode

The actor returned a block handle that doesn’t exist

Source

pub const FIRST_USER_EXIT_CODE: u32 = 16u32

The lowest exit code that an actor may abort with.

Source

pub const USR_ILLEGAL_ARGUMENT: ExitCode

The method parameters are invalid.

Source

pub const USR_NOT_FOUND: ExitCode

The requested resource does not exist.

Source

pub const USR_FORBIDDEN: ExitCode

The requested operation is forbidden.

Source

pub const USR_INSUFFICIENT_FUNDS: ExitCode

The actor has insufficient funds to perform the requested operation.

Source

pub const USR_ILLEGAL_STATE: ExitCode

The actor’s internal state is invalid.

Source

pub const USR_SERIALIZATION: ExitCode

There was a de/serialization failure within actor code.

Source

pub const USR_UNHANDLED_MESSAGE: ExitCode

The message cannot be handled (usually indicates an unhandled method number).

Source

pub const USR_UNSPECIFIED: ExitCode

The actor failed with an unspecified error.

Source

pub const USR_ASSERTION_FAILED: ExitCode

The actor failed a user-level assertion.

Source

pub const USR_READ_ONLY: ExitCode

The requested operation cannot be performed in “read-only” mode.

Source

pub const USR_NOT_PAYABLE: ExitCode

The method cannot handle a transfer of value.

Trait Implementations§

Source§

impl Clone for ExitCode

Source§

fn clone(&self) -> ExitCode

Returns a copy 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 ExitCode

Source§

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

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

impl<'de> Deserialize<'de> for ExitCode

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 Display for ExitCode

Source§

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

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

impl From<u32> for ExitCode

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ExitCode

Source§

fn eq(&self, other: &ExitCode) -> 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 ExitCode

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 Copy for ExitCode

Source§

impl Eq for ExitCode

Source§

impl StructuralPartialEq for ExitCode

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
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<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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

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