#[non_exhaustive]pub enum MemoryError {
Region(String),
CouldNotGrow {
current: Pages,
attempted_delta: Pages,
},
InvalidMemory {
reason: String,
},
MinimumMemoryTooLarge {
min_requested: Pages,
max_allowed: Pages,
},
MaximumMemoryTooLarge {
max_requested: Pages,
max_allowed: Pages,
},
MemoryNotShared,
UnsupportedOperation {
message: String,
},
AtomicsNotSupported,
Generic(String),
}
Expand description
Error type describing things that can go wrong when operating on Wasm Memories.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Region(String)
Low level error with mmap.
CouldNotGrow
The operation would cause the size of the memory to exceed the maximum or would cause an overflow leading to unindexable memory.
Fields
InvalidMemory
Invalid memory was provided.
MinimumMemoryTooLarge
Caller asked for more minimum memory than we can give them.
Fields
MaximumMemoryTooLarge
Caller asked for a maximum memory greater than we can give them.
Fields
Returned when a shared memory is required, but the given memory is not shared.
UnsupportedOperation
Returned when trying to call a memory operation that is not supported by the particular memory implementation.
AtomicsNotSupported
The memory does not support atomic operations.
Generic(String)
A user defined error value, used for error cases not listed above.
Trait Implementations§
Source§impl Clone for MemoryError
impl Clone for MemoryError
Source§fn clone(&self) -> MemoryError
fn clone(&self) -> MemoryError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MemoryError
impl Debug for MemoryError
Source§impl Display for MemoryError
impl Display for MemoryError
Source§impl Error for MemoryError
impl Error for MemoryError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl Hash for MemoryError
impl Hash for MemoryError
Source§impl PartialEq for MemoryError
impl PartialEq for MemoryError
impl Eq for MemoryError
impl StructuralPartialEq for MemoryError
Auto Trait Implementations§
impl Freeze for MemoryError
impl RefUnwindSafe for MemoryError
impl Send for MemoryError
impl Sync for MemoryError
impl Unpin for MemoryError
impl UnwindSafe for MemoryError
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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§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
Compare self to
key
and return true
if they are equal.Source§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>
Returns the layout of the type.