pub struct DebuggerComponent { /* private fields */ }Expand description
Auto-generated bindings for an instance a component which
implements the world debug-main.
This structure can be created through a number of means depending on your requirements and what you have on hand:
-
The most convenient way is to use
DebugMain::instantiatewhich only needs aStore,Component, andLinker. -
Alternatively you can create a [
DebugMainPre] ahead of time with aComponentto front-load string lookups of exports once instead of per-instantiation. This method then uses [DebugMainPre::instantiate] to create aDebugMain. -
If you’ve instantiated the instance yourself already then you can use
DebugMain::new.
These methods are all equivalent to one another and move around the tradeoff of what work is performed when.
Implementations§
Source§impl DebugMain
impl DebugMain
Sourcepub fn instantiate<_T>(
store: impl AsContextMut<Data = _T>,
component: &Component,
linker: &Linker<_T>,
) -> Result<DebugMain>
pub fn instantiate<_T>( store: impl AsContextMut<Data = _T>, component: &Component, linker: &Linker<_T>, ) -> Result<DebugMain>
Convenience wrapper around [DebugMainPre::new] and
[DebugMainPre::instantiate].
Sourcepub fn new(store: impl AsContextMut, instance: &Instance) -> Result<DebugMain>
pub fn new(store: impl AsContextMut, instance: &Instance) -> Result<DebugMain>
Convenience wrapper around [DebugMainIndices::new] and
[DebugMainIndices::load].
Sourcepub async fn instantiate_async<_T>(
store: impl AsContextMut<Data = _T>,
component: &Component,
linker: &Linker<_T>,
) -> Result<DebugMain>where
_T: Send,
pub async fn instantiate_async<_T>(
store: impl AsContextMut<Data = _T>,
component: &Component,
linker: &Linker<_T>,
) -> Result<DebugMain>where
_T: Send,
Convenience wrapper around [DebugMainPre::new] and
[DebugMainPre::instantiate_async].