Struct casper_execution_engine::shared::wasm_config::WasmConfig
source · pub struct WasmConfig {
pub max_memory: u32,
pub max_stack_height: u32,
/* private fields */
}
Expand description
Configuration of the Wasm execution environment.
This structure contains various Wasm execution configuration options, such as memory limits, stack limits and costs.
Fields§
§max_memory: u32
Maximum amount of heap memory (represented in 64kB pages) each contract can use.
max_stack_height: u32
Max stack height (native WebAssembly stack limiter).
Implementations§
source§impl WasmConfig
impl WasmConfig
sourcepub const fn new(
max_memory: u32,
max_stack_height: u32,
opcode_costs: OpcodeCosts,
storage_costs: StorageCosts,
host_function_costs: HostFunctionCosts,
) -> Self
pub const fn new( max_memory: u32, max_stack_height: u32, opcode_costs: OpcodeCosts, storage_costs: StorageCosts, host_function_costs: HostFunctionCosts, ) -> Self
Creates new Wasm config.
sourcepub fn opcode_costs(&self) -> OpcodeCosts
pub fn opcode_costs(&self) -> OpcodeCosts
Returns opcode costs.
sourcepub fn storage_costs(&self) -> StorageCosts
pub fn storage_costs(&self) -> StorageCosts
Returns storage costs.
sourcepub fn take_host_function_costs(self) -> HostFunctionCosts
pub fn take_host_function_costs(self) -> HostFunctionCosts
Returns host function costs and consumes this object.
Trait Implementations§
source§impl Clone for WasmConfig
impl Clone for WasmConfig
source§fn clone(&self) -> WasmConfig
fn clone(&self) -> WasmConfig
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 DataSize for WasmConfig
impl DataSize for WasmConfig
source§const IS_DYNAMIC: bool = false
const IS_DYNAMIC: bool = false
If
true
, the type has a heap size that can vary at runtime, depending on the actual value.source§const STATIC_HEAP_SIZE: usize = 0usize
const STATIC_HEAP_SIZE: usize = 0usize
The amount of space a value of the type always occupies. If
IS_DYNAMIC
is false, this is
the total amount of heap memory occupied by the value. Otherwise this is a lower bound.source§fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
Estimates the size of heap memory taken up by this value. Read more
source§impl Debug for WasmConfig
impl Debug for WasmConfig
source§impl Default for WasmConfig
impl Default for WasmConfig
source§impl<'de> Deserialize<'de> for WasmConfig
impl<'de> Deserialize<'de> for WasmConfig
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Distribution<WasmConfig> for Standard
impl Distribution<WasmConfig> for Standard
source§impl FromBytes for WasmConfig
impl FromBytes for WasmConfig
source§impl PartialEq for WasmConfig
impl PartialEq for WasmConfig
source§impl Serialize for WasmConfig
impl Serialize for WasmConfig
source§impl ToBytes for WasmConfig
impl ToBytes for WasmConfig
source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Returns the length of the
Vec<u8>
which would be returned from a successful call to
to_bytes()
or into_bytes()
. The data is not actually serialized, so this call is
relatively cheap.impl Copy for WasmConfig
impl Eq for WasmConfig
impl StructuralPartialEq for WasmConfig
Auto Trait Implementations§
impl Freeze for WasmConfig
impl RefUnwindSafe for WasmConfig
impl Send for WasmConfig
impl Sync for WasmConfig
impl Unpin for WasmConfig
impl UnwindSafe for WasmConfig
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§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> 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.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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<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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more