Struct wasm_component_layer::Component
source · pub struct Component(/* private fields */);
Expand description
A parsed and validated WebAssembly component, which may be used to instantiate Instance
s.
Implementations§
source§impl Component
impl Component
sourcepub fn new<E: WasmEngine>(engine: &Engine<E>, bytes: &[u8]) -> Result<Self>
pub fn new<E: WasmEngine>(engine: &Engine<E>, bytes: &[u8]) -> Result<Self>
Creates a new component with the given engine and binary data.
sourcepub fn exports(&self) -> &ComponentTypes
pub fn exports(&self) -> &ComponentTypes
The types and interfaces exported by this component.
sourcepub fn imports(&self) -> &ComponentTypes
pub fn imports(&self) -> &ComponentTypes
The types and interfaces imported by this component. To instantiate
the component, all of these imports must be satisfied by the Linker
.
sourcepub fn package(&self) -> &PackageIdentifier
pub fn package(&self) -> &PackageIdentifier
The root package of this component.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Component
impl Send for Component
impl Sync for Component
impl Unpin for Component
impl !UnwindSafe for Component
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