Enum linera_witty::RuntimeError
source · pub enum RuntimeError {
Show 16 variants
AllocationTooLarge,
InvalidAlignment,
AllocationFailed,
DeallocateInvalidAddress,
FunctionNotFound(String),
NotAFunction(String),
MissingMemory,
NotMemory,
InvalidString(FromUtf8Error),
InvalidNumber(TryFromIntError),
InvalidVariant {
type_name: &'static str,
discriminant: i64,
},
Custom(Error),
Wasmer(RuntimeError),
WasmerMemory(MemoryAccessError),
Wasmtime(Error),
WasmtimeTrap(Trap),
}
Expand description
Errors that can occur when using a Wasm runtime.
Variants§
AllocationTooLarge
Attempt to allocate a buffer larger than i32::MAX
.
InvalidAlignment
Attempt to allocate a buffer that’s aligned to an invalid boundary.
AllocationFailed
Call to cabi_realloc
returned a negative value instead of a valid address.
DeallocateInvalidAddress
Attempt to deallocate an address that’s after i32::MAX
.
FunctionNotFound(String)
Attempt to load a function not exported from a module.
NotAFunction(String)
Attempt to load a function with a name that’s used for a different import in the module.
MissingMemory
Attempt to load the memory export from a module that doesn’t export it.
NotMemory
Attempt to load the memory export from a module that exports it as something else.
InvalidString(FromUtf8Error)
Attempt to load a string from a sequence of bytes that doesn’t contain a UTF-8 string.
InvalidNumber(TryFromIntError)
Attempt to create a GuestPointer
from an invalid address representation.
InvalidVariant
Attempt to load an enum
type but the discriminant doesn’t match any of the variants.
Fields
Custom(Error)
A custom error reported by one of the Wasm host’s function handlers.
Wasmer(RuntimeError)
Wasmer runtime error.
WasmerMemory(MemoryAccessError)
Attempt to access an invalid memory address using Wasmer.
Wasmtime(Error)
Wasmtime error.
WasmtimeTrap(Trap)
Wasmtime trap during execution.
Trait Implementations§
source§impl Debug for RuntimeError
impl Debug for RuntimeError
source§impl Display for RuntimeError
impl Display for RuntimeError
source§impl Error for RuntimeError
impl Error for RuntimeError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<FromUtf8Error> for RuntimeError
impl From<FromUtf8Error> for RuntimeError
source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
source§impl From<MemoryAccessError> for RuntimeError
impl From<MemoryAccessError> for RuntimeError
source§fn from(source: MemoryAccessError) -> Self
fn from(source: MemoryAccessError) -> Self
source§impl From<RuntimeError> for RuntimeError
impl From<RuntimeError> for RuntimeError
source§fn from(source: RuntimeError) -> Self
fn from(source: RuntimeError) -> Self
source§impl From<Trap> for RuntimeError
impl From<Trap> for RuntimeError
source§impl From<TryFromIntError> for RuntimeError
impl From<TryFromIntError> for RuntimeError
source§fn from(source: TryFromIntError) -> Self
fn from(source: TryFromIntError) -> Self
Auto Trait Implementations§
impl Freeze for RuntimeError
impl !RefUnwindSafe for RuntimeError
impl Send for RuntimeError
impl Sync for RuntimeError
impl Unpin for RuntimeError
impl !UnwindSafe for RuntimeError
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<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
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<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> IntoAnyhow for T
impl<T> IntoAnyhow for T
source§fn into_anyhow(self) -> Error
fn into_anyhow(self) -> Error
self
into an anyhow::Error
.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 moresource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
source§impl<T> MockResults for T
impl<T> MockResults for T
§type Results = T
type Results = T
MockInstance
.source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
source§fn read<'instance>(
&self,
instance: &'instance &mut I,
location: GuestPointer,
length: u32,
) -> Result<Cow<'instance, [u8]>, RuntimeError>
fn read<'instance>( &self, instance: &'instance &mut I, location: GuestPointer, length: u32, ) -> Result<Cow<'instance, [u8]>, RuntimeError>
Reads length
bytes from memory from the provided location
.
source§fn write(
&mut self,
instance: &mut &mut I,
location: GuestPointer,
bytes: &[u8],
) -> Result<(), RuntimeError>
fn write( &mut self, instance: &mut &mut I, location: GuestPointer, bytes: &[u8], ) -> Result<(), RuntimeError>
Writes the bytes
to memory at the provided location
.