class Engine[F[_]] extends ModuleLoader[F]
This is the engine used to compile, instantiate and run modules. It exposes all the needed interface to interact with modules.
You typically want to reuse the same instance for all your executions
over the same effectful type F
.
- Source
- Engine.scala
- Alphabetic
- By Inheritance
- Engine
- ModuleLoader
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def compile(sections: Stream[F, Section]): F[Module[F]]
Reads the given stream of binary module sections, validates, and compiles it.
Reads the given stream of binary module sections, validates, and compiles it. The returned compiled Module can then be instantiated to be run.
If validation or compilation fails, returns an error with the message wrapped in it.
- def compile(path: Path, blocker: Blocker, chunkSize: Int = 1024)(implicit cs: ContextShift[F]): F[Module[F]]
Reads the
.wasm
file at the given path, validates, and compiles it.Reads the
.wasm
file at the given path, validates, and compiles it. The returned compiled Module can then be instantiated to be run.If validation or compilation fails, returns an error with the message wrapped in it.
- def compileBytes(bytes: Stream[F, Byte]): F[Module[F]]
Reads the given binary encoded module, validates, and compiles it.
Reads the given binary encoded module, validates, and compiles it. The returned compiled Module can then be instantiated to be run.
If validation or compilation fails, returns an error with the message wrapped in it.
- val conf: EngineConfiguration
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def instantiate(module: Module[F], imports: Imports[F]): F[Instance[F]]
Instantiates the previously validated and compiled module.
Instantiates the previously validated and compiled module. The returned Instance can then be used to access exported elements.
If instantiation fails, returns an error with the message wrapped in it.
- def instantiate(sections: Stream[F, Section], imports: Imports[F]): F[Instance[F]]
Reads the given stream of binary module sections, validates, compiles, and instantiates it.
Reads the given stream of binary module sections, validates, compiles, and instantiates it. The returned Instance can then be used to access exported elements.
If validation, compilation, or instantiation fails, returns an error with the message wrapped in it.
- def instantiate(path: Path, imports: Imports[F], blocker: Blocker, chunkSize: Int = 1024)(implicit cs: ContextShift[F]): F[Instance[F]]
Reads the
.wasm
file at the given path, validates, compiles, and instantiates it.Reads the
.wasm
file at the given path, validates, compiles, and instantiates it. The returned Instance can then be used to access exported elements.If validation, compilation, or instantiation fails, returns an error with the message wrapped in it.
- def instantiateBytes(bytes: Stream[F, Byte], imports: Imports[F]): F[Instance[F]]
Reads the given binary encoded module, validates, compiles, and instantiates it.
Reads the given binary encoded module, validates, compiles, and instantiates it. The returned Instance can then be used to access exported elements.
If validation, compilation, or instantiation fails, returns an error with the message wrapped in it.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def sections(bytes: Stream[F, Byte]): Stream[F, Section]
Reads a binary module from the given bytes.
Reads a binary module from the given bytes.
- Definition Classes
- ModuleLoader
- def sections(path: Path, blocker: Blocker, chunkSize: Int = 1024)(implicit cs: ContextShift[F]): Stream[F, Section]
Reads a binary module from the given path.
Reads a binary module from the given path.
- Definition Classes
- ModuleLoader
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def validate(sections: Stream[F, Section]): F[Unit]
Reads the given stream of binary module sections and validates it.
Reads the given stream of binary module sections and validates it.
If validation fails, returns an error with the validation message wrapped in it.
- def validate(path: Path, blocker: Blocker, chunkSize: Int = 1024)(implicit cs: ContextShift[F]): F[Unit]
Reads the
.wasm
file at the given path and validates it.Reads the
.wasm
file at the given path and validates it.If validation fails, returns an error with the validation message wrapped in it.
- def validateBytes(bytes: Stream[F, Byte]): F[Unit]
Reads the given binary encoded module and validates it.
Reads the given binary encoded module and validates it.
If validation fails, returns an error with the validation message wrapped in it.
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
- Deprecated
(Since version ) see corresponding Javadoc for more information.