pub enum MemoryGrowCost {
Free,
Linear(NonZeroU32),
}
Expand description
Dynamic costs for memory growth.
Variants
Free
Skip per page charge.
Note
This makes sense when the amount of pages that a module is allowed to use is limited
to a rather small number by static validation. In that case it is viable to
benchmark the costs of memory.grow
as the worst case (growing to to the maximum
number of pages).
Linear(NonZeroU32)
Charge the specified amount for each page that the memory is grown by.
Trait Implementations
sourceimpl Clone for MemoryGrowCost
impl Clone for MemoryGrowCost
sourcefn clone(&self) -> MemoryGrowCost
fn clone(&self) -> MemoryGrowCost
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for MemoryGrowCost
impl Debug for MemoryGrowCost
sourceimpl PartialEq<MemoryGrowCost> for MemoryGrowCost
impl PartialEq<MemoryGrowCost> for MemoryGrowCost
sourcefn eq(&self, other: &MemoryGrowCost) -> bool
fn eq(&self, other: &MemoryGrowCost) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
impl Copy for MemoryGrowCost
impl Eq for MemoryGrowCost
impl StructuralEq for MemoryGrowCost
impl StructuralPartialEq for MemoryGrowCost
Auto Trait Implementations
impl RefUnwindSafe for MemoryGrowCost
impl Send for MemoryGrowCost
impl Sync for MemoryGrowCost
impl Unpin for MemoryGrowCost
impl UnwindSafe for MemoryGrowCost
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more