pub struct Linker { /* private fields */ }
Expand description
Builder type for composing dynamic library modules into a component
Implementations§
Source§impl Linker
impl Linker
Sourcepub fn library(
self,
name: &str,
module: &[u8],
dl_openable: bool,
) -> Result<Self>
pub fn library( self, name: &str, module: &[u8], dl_openable: bool, ) -> Result<Self>
Add a dynamic library module to this linker.
If dl_openable
is true, all of the libraries exports will be added to the dlopen
/dlsym
lookup table
for runtime resolution.
Sourcepub fn adapter(self, name: &str, module: &[u8]) -> Result<Self>
pub fn adapter(self, name: &str, module: &[u8]) -> Result<Self>
Add an adapter to this linker.
See crate::encoding::ComponentEncoder::adapter for details.
Sourcepub fn validate(self, validate: bool) -> Self
pub fn validate(self, validate: bool) -> Self
Specify whether to validate the resulting component prior to returning it
Sourcepub fn stack_size(self, stack_size: u32) -> Self
pub fn stack_size(self, stack_size: u32) -> Self
Specify size of stack to allocate in the synthesized main module
Sourcepub fn stub_missing_functions(self, stub_missing_functions: bool) -> Self
pub fn stub_missing_functions(self, stub_missing_functions: bool) -> Self
Specify whether to generate trapping stubs for any unresolved imports
Sourcepub fn use_built_in_libdl(self, use_built_in_libdl: bool) -> Self
pub fn use_built_in_libdl(self, use_built_in_libdl: bool) -> Self
Specify whether to use a built-in implementation of dlopen
/dlsym
.
Sourcepub fn merge_imports_based_on_semver(self, merge: bool) -> Self
pub fn merge_imports_based_on_semver(self, merge: bool) -> Self
This affects how when to WIT worlds are merged together, for example from two different libraries, whether their imports are unified when the semver version ranges for interface allow it.
This is enabled by default.