pub enum CodeError {
Show 16 variants ImportSectionNotFound, MemoryEntryNotFound, ExportSectionNotFound, RequiredExportFnNotFound, NonGearExportFnFound, Decode, GasInjection, StackLimitInjection, Encode, StartSectionExists, InvalidStaticPageCount, StackEndInitialization, DataSegmentInitialization, StackEndOverlaps, IncorrectGlobalIndex, MutGlobalExport,
}
Expand description

Instrumentation error.

Variants§

§

ImportSectionNotFound

The provided code doesn’t contain required import section.

§

MemoryEntryNotFound

The provided code doesn’t contain memory entry section.

§

ExportSectionNotFound

The provided code doesn’t contain export section.

§

RequiredExportFnNotFound

The provided code doesn’t contain the required init or handle export function.

§

NonGearExportFnFound

The provided code contains unnecessary function exports.

§

Decode

Error occurred during decoding original program code.

The provided code was a malformed Wasm bytecode or contained unsupported features (atomics, simd instructions, etc.).

§

GasInjection

Error occurred during injecting gas metering instructions.

This might be due to program contained unsupported/non-deterministic instructions (floats, manual memory grow, etc.).

§

StackLimitInjection

Error occurred during stack height instrumentation.

§

Encode

Error occurred during encoding instrumented program.

The only possible reason for that might be OOM.

§

StartSectionExists

We restrict start sections in smart contracts.

§

InvalidStaticPageCount

The provided code has invalid count of static pages.

§

StackEndInitialization

Unsupported initialization of gear stack end global variable.

§

DataSegmentInitialization

Unsupported initialization of data segment.

§

StackEndOverlaps

Pointer to the stack end overlaps data segment.

§

IncorrectGlobalIndex

Incorrect global export index. Can occur when export refers to not existing global index.

§

MutGlobalExport

Gear protocol restriction for now.

Trait Implementations§

source§

impl Debug for CodeError

source§

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

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

impl Display for CodeError

source§

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

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

impl PartialEq<CodeError> for CodeError

source§

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

source§

impl StructuralEq for CodeError

source§

impl StructuralPartialEq for CodeError

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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 Twhere 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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.
source§

impl<T> JsonSchemaMaybe for T