mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-29 00:21:34 +00:00
Add lots of rustdocs and clean up one line of code
This commit is contained in:
@ -189,6 +189,10 @@ pub fn instantiate(wasm: &[u8], import_object: &ImportObject) -> error::Result<I
|
||||
}
|
||||
|
||||
/// Get a single instance of the default compiler to use.
|
||||
///
|
||||
/// The ouptput of this function can be controlled by the mutually
|
||||
/// exclusive `default-backend-llvm`, `default-backend-singlepass`,
|
||||
/// and `default-backend-cranelift` feature flags.
|
||||
pub fn default_compiler() -> impl Compiler {
|
||||
#[cfg(any(
|
||||
all(
|
||||
@ -219,6 +223,11 @@ pub fn default_compiler() -> impl Compiler {
|
||||
DefaultCompiler::new()
|
||||
}
|
||||
|
||||
/// Get the `Compiler` as a trait object for the given `Backend`.
|
||||
/// Returns `Option` because support for the `Compiler` may not be enabled by
|
||||
/// feature flags.
|
||||
///
|
||||
/// To get a list of the enabled backends as strings, call `Backend::variants()`
|
||||
pub fn compiler_for_backend(backend: Backend) -> Option<Box<dyn Compiler>> {
|
||||
match backend {
|
||||
#[cfg(feature = "cranelift")]
|
||||
|
Reference in New Issue
Block a user