pub enum MemoryError {
OutOfSystemMemory,
OutOfBoundsGrowth,
OutOfBoundsAccess,
InvalidMemoryType,
InvalidStaticBufferSize,
ResourceLimiterDeniedAllocation,
MinimumSizeOverflow,
MaximumSizeOverflow,
OutOfFuel {
required_fuel: u64,
},
}Expand description
An error that may occur upon operating with virtual or linear memory.
Variants§
OutOfSystemMemory
Tried to allocate more virtual memory than technically possible.
OutOfBoundsGrowth
Tried to grow linear memory out of its set bounds.
OutOfBoundsAccess
Tried to access linear memory out of bounds.
InvalidMemoryType
Tried to create an invalid linear memory type.
InvalidStaticBufferSize
Tried to create memory with invalid static buffer size
ResourceLimiterDeniedAllocation
If a resource limiter denied allocation or growth of a linear memory.
MinimumSizeOverflow
The minimum size of the memory type overflows the system index type.
MaximumSizeOverflow
The maximum size of the memory type overflows the system index type.
OutOfFuel
Encountered if a memory.grow operation runs out of fuel.
Trait Implementations§
Source§impl Clone for MemoryError
impl Clone for MemoryError
Source§fn clone(&self) -> MemoryError
fn clone(&self) -> MemoryError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MemoryError
Source§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 From<LimiterError> for MemoryError
impl From<LimiterError> for MemoryError
Source§fn from(error: LimiterError) -> MemoryError
fn from(error: LimiterError) -> MemoryError
Converts to this type from the input type.
Source§impl From<MemoryError> for Error
impl From<MemoryError> for Error
Source§fn from(error: MemoryError) -> Self
fn from(error: MemoryError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MemoryError
impl RefUnwindSafe for MemoryError
impl Send for MemoryError
impl Sync for MemoryError
impl Unpin for MemoryError
impl UnsafeUnpin for MemoryError
impl UnwindSafe for MemoryError
Blanket Implementations§
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