pub enum HeapAllocStrategy {
Static {
extra_pages: u32,
},
Dynamic {
maximum_pages: Option<u32>,
},
}Expand description
Defines the heap pages allocation strategy the wasm runtime should use.
A heap page is defined as 64KiB of memory.
Variants§
Static
Allocate a static number of heap pages.
The total number of allocated heap pages is the initial number of heap pages requested by
the wasm file plus the extra_pages.
Fields
Dynamic
Allocate the initial heap pages as requested by the wasm file and then allow it to grow dynamically.
Trait Implementations§
Source§impl Clone for HeapAllocStrategy
impl Clone for HeapAllocStrategy
Source§fn clone(&self) -> HeapAllocStrategy
fn clone(&self) -> HeapAllocStrategy
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 HeapAllocStrategy
Source§impl Debug for HeapAllocStrategy
impl Debug for HeapAllocStrategy
impl Eq for HeapAllocStrategy
Source§impl Hash for HeapAllocStrategy
impl Hash for HeapAllocStrategy
Source§impl PartialEq for HeapAllocStrategy
impl PartialEq for HeapAllocStrategy
Source§fn eq(&self, other: &HeapAllocStrategy) -> bool
fn eq(&self, other: &HeapAllocStrategy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for HeapAllocStrategy
Auto Trait Implementations§
impl Freeze for HeapAllocStrategy
impl RefUnwindSafe for HeapAllocStrategy
impl Send for HeapAllocStrategy
impl Sync for HeapAllocStrategy
impl Unpin for HeapAllocStrategy
impl UnsafeUnpin for HeapAllocStrategy
impl UnwindSafe for HeapAllocStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.