Enum wasmtime_environ::MemoryStyle
source · Expand description
Implementation styles for WebAssembly linear memory.
Variants§
Implementations§
source§impl MemoryStyle
impl MemoryStyle
sourcepub fn for_memory(memory: Memory, tunables: &Tunables) -> (Self, u64)
pub fn for_memory(memory: Memory, tunables: &Tunables) -> (Self, u64)
Decide on an implementation style for the given Memory
.
Examples found in repository?
src/module.rs (line 88)
87 88 89 90 91 92 93 94 95 96 97 98 99
pub fn for_memory(memory: Memory, tunables: &Tunables) -> Self {
let (style, offset_guard_size) = MemoryStyle::for_memory(memory, tunables);
Self {
memory,
style,
offset_guard_size,
pre_guard_size: if tunables.guard_before_linear_memory {
offset_guard_size
} else {
0
},
}
}
Trait Implementations§
source§impl Clone for MemoryStyle
impl Clone for MemoryStyle
source§fn clone(&self) -> MemoryStyle
fn clone(&self) -> MemoryStyle
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 MemoryStyle
impl Debug for MemoryStyle
source§impl<'de> Deserialize<'de> for MemoryStyle
impl<'de> Deserialize<'de> for MemoryStyle
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