Struct wasm_component_layer::LinkerInstance
source · pub struct LinkerInstance { /* private fields */ }
Expand description
Describes a concrete interface which components may import.
Implementations§
source§impl LinkerInstance
impl LinkerInstance
sourcepub fn define_func(
&mut self,
name: impl Into<Arc<str>>,
func: Func
) -> Result<()>
pub fn define_func( &mut self, name: impl Into<Arc<str>>, func: Func ) -> Result<()>
Defines a new function for this interface with the provided name. Fails if the function already exists.
sourcepub fn func(&self, name: impl AsRef<str>) -> Option<Func>
pub fn func(&self, name: impl AsRef<str>) -> Option<Func>
Gets the function in this interface with the given name, if any.
sourcepub fn define_resource(
&mut self,
name: impl Into<Arc<str>>,
resource_ty: ResourceType
) -> Result<()>
pub fn define_resource( &mut self, name: impl Into<Arc<str>>, resource_ty: ResourceType ) -> Result<()>
Defines a new resource type for this interface with the provided name. Fails if the resource type already exists, or if the resource is abstract.
sourcepub fn resource(&self, name: impl AsRef<str>) -> Option<ResourceType>
pub fn resource(&self, name: impl AsRef<str>) -> Option<ResourceType>
Gets the resource in this interface with the given name, if any.
sourcepub fn funcs(&self) -> impl Iterator<Item = (&str, Func)>
pub fn funcs(&self) -> impl Iterator<Item = (&str, Func)>
Iterates over all associated functions by name.
sourcepub fn resources(&self) -> impl Iterator<Item = (&str, ResourceType)>
pub fn resources(&self) -> impl Iterator<Item = (&str, ResourceType)>
Iterates over all associated functions by name.
Trait Implementations§
source§impl Clone for LinkerInstance
impl Clone for LinkerInstance
source§fn clone(&self) -> LinkerInstance
fn clone(&self) -> LinkerInstance
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 LinkerInstance
impl Debug for LinkerInstance
source§impl Default for LinkerInstance
impl Default for LinkerInstance
source§fn default() -> LinkerInstance
fn default() -> LinkerInstance
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for LinkerInstance
impl Send for LinkerInstance
impl Sync for LinkerInstance
impl Unpin for LinkerInstance
impl !UnwindSafe for LinkerInstance
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