Enum hdk::prelude::result::WasmErrorInner
source · pub enum WasmErrorInner {
PointerMap,
Deserialize(Vec<u8>),
Serialize(SerializedBytesError),
ErrorWhileError,
Memory,
Guest(String),
Host(String),
HostShortCircuit(Vec<u8>),
Compile(String),
CallError(String),
UninitializedSerializedModuleCache,
}
Expand description
Enum of all possible ERROR states that wasm can encounter.
Used in [wasm_error!
] for specifying the error type and message.
Variants§
PointerMap
While moving pointers and lengths across the host/guest, we hit an unsafe conversion such as a negative pointer or out of bounds value.
Deserialize(Vec<u8>)
These bytes failed to deserialize. The host should provide nice debug info and context that the wasm guest won’t have.
Serialize(SerializedBytesError)
Something failed to serialize.
This should be rare or impossible for almost everything that implements Serialize
.
ErrorWhileError
Somehow we errored while erroring. For example, maybe we failed to serialize an error while attempting to serialize an error.
Memory
Something went wrong while writing or reading bytes to/from wasm memory. Whatever this is, it is very bad and probably not recoverable.
Guest(String)
Error with guest logic that the host doesn’t know about.
Host(String)
Error with host logic that the guest doesn’t know about.
HostShortCircuit(Vec<u8>)
Something to do with host logic that the guest doesn’t know about
AND wasm execution MUST immediately halt.
The Vec<u8>
holds the encoded data as though the guest had returned.
Compile(String)
Wasmer failed to compile machine code from wasm byte code.
CallError(String)
The host failed to call a function in the guest.
UninitializedSerializedModuleCache
Host attempted to interact with the module cache before it was initialized.
Implementations§
source§impl WasmErrorInner
impl WasmErrorInner
sourcepub fn maybe_corrupt(&self) -> bool
pub fn maybe_corrupt(&self) -> bool
Some errors indicate the wasm guest is potentially corrupt and so the host MUST NOT reuse it (e.g. in a cache of wasm instances). Other errors MAY NOT invalidate an instance cache on the host.
Trait Implementations§
source§impl Clone for WasmErrorInner
impl Clone for WasmErrorInner
source§fn clone(&self) -> WasmErrorInner
fn clone(&self) -> WasmErrorInner
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WasmErrorInner
impl Debug for WasmErrorInner
source§impl<'de> Deserialize<'de> for WasmErrorInner
impl<'de> Deserialize<'de> for WasmErrorInner
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WasmErrorInner, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WasmErrorInner, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl From<&str> for WasmErrorInner
impl From<&str> for WasmErrorInner
source§fn from(s: &str) -> WasmErrorInner
fn from(s: &str) -> WasmErrorInner
source§impl<T> From<CompositeHashConversionError<T>> for WasmErrorInnerwhere
T: HashType,
impl<T> From<CompositeHashConversionError<T>> for WasmErrorInnerwhere
T: HashType,
source§fn from(err: CompositeHashConversionError<T>) -> WasmErrorInner
fn from(err: CompositeHashConversionError<T>) -> WasmErrorInner
source§impl<T, P> From<HashConversionError<T, P>> for WasmErrorInnerwhere
T: HashType,
P: PrimitiveHashType,
impl<T, P> From<HashConversionError<T, P>> for WasmErrorInnerwhere
T: HashType,
P: PrimitiveHashType,
source§fn from(err: HashConversionError<T, P>) -> WasmErrorInner
fn from(err: HashConversionError<T, P>) -> WasmErrorInner
source§impl From<SerializedBytesError> for WasmErrorInner
impl From<SerializedBytesError> for WasmErrorInner
source§fn from(error: SerializedBytesError) -> WasmErrorInner
fn from(error: SerializedBytesError) -> WasmErrorInner
source§impl From<String> for WasmErrorInner
impl From<String> for WasmErrorInner
source§fn from(s: String) -> WasmErrorInner
fn from(s: String) -> WasmErrorInner
source§impl From<TryFromIntError> for WasmErrorInner
impl From<TryFromIntError> for WasmErrorInner
source§fn from(_: TryFromIntError) -> WasmErrorInner
fn from(_: TryFromIntError) -> WasmErrorInner
source§impl From<TryFromSliceError> for WasmErrorInner
impl From<TryFromSliceError> for WasmErrorInner
source§fn from(_: TryFromSliceError) -> WasmErrorInner
fn from(_: TryFromSliceError) -> WasmErrorInner
source§impl Hash for WasmErrorInner
impl Hash for WasmErrorInner
source§impl Ord for WasmErrorInner
impl Ord for WasmErrorInner
source§fn cmp(&self, other: &WasmErrorInner) -> Ordering
fn cmp(&self, other: &WasmErrorInner) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for WasmErrorInner
impl PartialEq for WasmErrorInner
source§impl PartialOrd for WasmErrorInner
impl PartialOrd for WasmErrorInner
source§impl Serialize for WasmErrorInner
impl Serialize for WasmErrorInner
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for WasmErrorInner
impl StructuralPartialEq for WasmErrorInner
Auto Trait Implementations§
impl Freeze for WasmErrorInner
impl RefUnwindSafe for WasmErrorInner
impl Send for WasmErrorInner
impl Sync for WasmErrorInner
impl Unpin for WasmErrorInner
impl UnwindSafe for WasmErrorInner
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
source§impl<T> CallHasher for T
impl<T> CallHasher for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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
key
and return true
if they are equal.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
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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>
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>
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