mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-22 13:11:32 +00:00
Add Pages and Bytes newtypes
This commit is contained in:
@ -140,6 +140,20 @@ impl PartialEq for CallError {
|
||||
}
|
||||
}
|
||||
|
||||
/// This error type is produced when creating something,
|
||||
/// like a `Memory` or a `Table`.
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum CreationError {
|
||||
UnableToCreateMemory,
|
||||
UnableToCreateTable,
|
||||
}
|
||||
|
||||
impl PartialEq for CreationError {
|
||||
fn eq(&self, _other: &CreationError) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
/// The amalgamation of all errors that can occur
|
||||
/// during the compilation, instantiation, or execution
|
||||
/// of a webassembly module.
|
||||
@ -152,6 +166,7 @@ pub enum Error {
|
||||
RuntimeError(RuntimeError),
|
||||
ResolveError(ResolveError),
|
||||
CallError(CallError),
|
||||
CreationError(CreationError),
|
||||
}
|
||||
|
||||
impl PartialEq for Error {
|
||||
@ -220,6 +235,12 @@ impl From<CallError> for Box<Error> {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<CreationError> for Box<Error> {
|
||||
fn from(creation_err: CreationError) -> Self {
|
||||
Box::new(Error::CreationError(creation_err))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<RuntimeError> for Box<CallError> {
|
||||
fn from(runtime_err: RuntimeError) -> Self {
|
||||
Box::new(CallError::Runtime(runtime_err))
|
||||
|
Reference in New Issue
Block a user