pub enum ModuleStartup {
None,
Always(EngineOrModuleTypeIndex),
IfMemoriesNeedInit(EngineOrModuleTypeIndex),
}Expand description
Different means of startup for a wasm module.
Variants§
None
No startup is necessary.
Always(EngineOrModuleTypeIndex)
Startup is always required, for example to apply active table segments.
The type of the startup function, of wasm signature [] -> [], is
provided here.
IfMemoriesNeedInit(EngineOrModuleTypeIndex)
Startup is only required if some linear memory within this module, at
runtime, says needs_init() == true.
This special mode of startup indicates that the startup function has no
purpose other than to initialize the initial contents of
MemoryInitialization::Static linear memories. In this situation if all
memories say needs_init() == false then the startup function won’t
actually do anything meaning that it can be optimized slightly by
skipping it entirely.
Implementations§
Trait Implementations§
Source§impl Debug for ModuleStartup
impl Debug for ModuleStartup
Source§impl<'de> Deserialize<'de> for ModuleStartup
impl<'de> Deserialize<'de> for ModuleStartup
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 Serialize for ModuleStartup
impl Serialize for ModuleStartup
Source§impl TypeTrace for ModuleStartup
impl TypeTrace for ModuleStartup
Source§fn trace_mut<F, E>(&mut self, func: &mut F) -> Result<(), E>
fn trace_mut<F, E>(&mut self, func: &mut F) -> Result<(), E>
Visit each edge, mutably. Read more
Source§fn trace_engine_indices<F, E>(&self, func: &mut F) -> Result<(), E>
fn trace_engine_indices<F, E>(&self, func: &mut F) -> Result<(), E>
Trace all
VMSharedTypeIndex edges, ignoring other edges.Source§fn canonicalize_for_runtime_usage<F>(&mut self, module_to_engine: &mut F)
fn canonicalize_for_runtime_usage<F>(&mut self, module_to_engine: &mut F)
Canonicalize
self by rewriting all type references inside self from
module-level interned type indices to engine-level interned type
indices. Read moreSource§fn is_canonicalized_for_runtime_usage(&self) -> bool
fn is_canonicalized_for_runtime_usage(&self) -> bool
Is this type canonicalized for runtime usage?
Source§fn canonicalize_for_hash_consing<F>(
&mut self,
rec_group_range: Range<ModuleInternedTypeIndex>,
module_to_engine: &mut F,
)
fn canonicalize_for_hash_consing<F>( &mut self, rec_group_range: Range<ModuleInternedTypeIndex>, module_to_engine: &mut F, )
Canonicalize
self by rewriting all type references inside self from
module-level interned type indices to either engine-level interned type
indices or recgroup-relative indices. Read moreSource§fn is_canonicalized_for_hash_consing(&self) -> bool
fn is_canonicalized_for_hash_consing(&self) -> bool
Is this type canonicalized for hash consing?
Auto Trait Implementations§
impl Freeze for ModuleStartup
impl RefUnwindSafe for ModuleStartup
impl Send for ModuleStartup
impl Sync for ModuleStartup
impl Unpin for ModuleStartup
impl UnsafeUnpin for ModuleStartup
impl UnwindSafe for ModuleStartup
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