Struct Reject

Source
pub struct Reject {
    pub error_code: NonZeroI32,
    pub return_value: Option<Vec<u8>>,
}
Expand description

An error message, signalling rejection of a smart contract invocation. The client will see the error code as a reject reason; if a schema is provided, the error message corresponding to the error code will be displayed. The valid range for an error code is from i32::MIN to -1. A return value can also be provided.

Fields§

§error_code: NonZeroI32§return_value: Option<Vec<u8>>

Implementations§

Source§

impl Reject

Source

pub fn new(x: i32) -> Option<Self>

This returns None for all values >= 0 and Some otherwise.

Trait Implementations§

Source§

impl Debug for Reject

Source§

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

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

impl Default for Reject

Default error is i32::MIN.

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<()> for Reject

Mapped to i32::MIN + 1.

Source§

fn from(_: ()) -> Self

Converts to this type from the input type.
Source§

impl<T> From<CallContractError<T>> for Reject

AmountTooLarge is i32::MIN + 15, MissingAccount is i32::MIN + 16, MissingContract is i32::MIN + 17, MissingEntrypoint is i32::MIN + 18, MessageFailed is i32::MIN + 19, LogicReject is i32::MIN + 20, Trap is i32::MIN + 21.

Source§

fn from(cce: CallContractError<T>) -> Self

Converts to this type from the input type.
Source§

impl From<LogError> for Reject

Full is mapped to i32::MIN + 3, Malformed is mapped to i32::MIN + 4.

Source§

fn from(le: LogError) -> Self

Converts to this type from the input type.
Source§

impl From<NewContractNameError> for Reject

MissingInitPrefix is mapped to i32::MIN + 5, TooLong to i32::MIN + 6, ContainsDot to i32::MIN + 9, and InvalidCharacters to i32::MIN + 10.

Source§

fn from(nre: NewContractNameError) -> Self

Converts to this type from the input type.
Source§

impl From<NewReceiveNameError> for Reject

MissingDotSeparator is mapped to i32::MIN + 7, TooLong to i32::MIN + 8, and InvalidCharacters to i32::MIN + 11.

Source§

fn from(nre: NewReceiveNameError) -> Self

Converts to this type from the input type.
Source§

impl From<NonZero<i32>> for Reject

Source§

fn from(error_code: NonZeroI32) -> Self

Converts to this type from the input type.
Source§

impl From<NotPayableError> for Reject

The error code is i32::MIN + 12.

Source§

fn from(_: NotPayableError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseError> for Reject

Mapped to i32::MIN + 2.

Source§

fn from(_: ParseError) -> Self

Converts to this type from the input type.
Source§

impl From<QueryAccountBalanceError> for Reject

Query account balance error missing account is i32::MIN + 25.

Source§

fn from(_: QueryAccountBalanceError) -> Self

Converts to this type from the input type.
Source§

impl From<QueryContractBalanceError> for Reject

Query contract balance error missing contract is i32::MIN + 26.

Source§

fn from(_: QueryContractBalanceError) -> Self

Converts to this type from the input type.
Source§

impl From<TransferError> for Reject

AmountTooLarge is i32::MIN + 13, MissingAccount is i32::MIN + 14.

Source§

fn from(te: TransferError) -> Self

Converts to this type from the input type.
Source§

impl From<UpgradeError> for Reject

MissingModule is i32::MIN + 22, MissingContract is i32::MIN + 23, UnsupportedModuleVersion is i32::MIN + 24.

Source§

fn from(te: UpgradeError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Reject

Source§

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

Source§

impl StructuralPartialEq for Reject

Auto Trait Implementations§

§

impl Freeze for Reject

§

impl RefUnwindSafe for Reject

§

impl Send for Reject

§

impl Sync for Reject

§

impl Unpin for Reject

§

impl UnwindSafe for Reject

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> 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, 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.