pub enum InstructionCost {
Fixed(u64),
Linear(u64, NonZeroU32),
}
Expand description
Dynamic costs instructions.
Variants§
Fixed(u64)
Charge fixed amount per instruction.
Linear(u64, NonZeroU32)
Charge the specified amount of base miligas, plus miligas based on the last item on the stack. For memory.grow this is the number of pages. For memory.copy this is the number of bytes to copy.
Note: in order to make overflows impossible, the second (cost per unit) value must be in range 0x1 ~ 0x7fff_ffff.
Trait Implementations§
source§impl Clone for InstructionCost
impl Clone for InstructionCost
source§fn clone(&self) -> InstructionCost
fn clone(&self) -> InstructionCost
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 InstructionCost
impl Debug for InstructionCost
source§impl PartialEq for InstructionCost
impl PartialEq for InstructionCost
source§fn eq(&self, other: &InstructionCost) -> bool
fn eq(&self, other: &InstructionCost) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for InstructionCost
impl Eq for InstructionCost
impl StructuralPartialEq for InstructionCost
Auto Trait Implementations§
impl Freeze for InstructionCost
impl RefUnwindSafe for InstructionCost
impl Send for InstructionCost
impl Sync for InstructionCost
impl Unpin for InstructionCost
impl UnwindSafe for InstructionCost
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: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default 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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.