Struct concordium_std::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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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§

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

§

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

§

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.