Packages

  • package root
    Definition Classes
    root
  • package swam
    Definition Classes
    root
  • package runtime

    This package contains all the classes and types related to running WebAssembly modules.

    This package contains all the classes and types related to running WebAssembly modules.

    The entry point for almost all users will be Engine. A typical use of the engine is:

    import swam._
    import text._
    import runtime._
    import exports._
    
    import cats.implicits._
    import cats.effect._
    
    import java.nio.file.Paths
    
    val tcompiler = Compiler[IO]
    val engine = Engine[IO]
    
    for {
      tcompiler <- tcompiler
      engine <- engine
      mod <- engine.compile(/* source of the module */)
      inst <- mod.newInstance()
      f <- inst.exports.function1[Int, Int]("f")
      res <- f(43)
    } yield res
    
    println(res.unsafeRunSync())
    Definition Classes
    swam
  • package imports
    Definition Classes
    runtime
  • package annotations
    Definition Classes
    imports
  • effect
  • effectful
  • global
  • module
  • pure
p

swam.runtime.imports

annotations

package annotations

Type Members

  1. class effect extends Annotation with StaticAnnotation

    If a type variable F[_] of a module class is annotated with this, then it is taken as the effect type for functions and module lookup.

    If a type variable F[_] of a module class is annotated with this, then it is taken as the effect type for functions and module lookup.

    It requires a MonadError[F, Throwable]..

  2. class effectful extends Annotation with StaticAnnotation

    def members marked with this annotation are exported as a function

    def members marked with this annotation are exported as a function

    The parameter and return types must have a SimpleValueFormatter.

    Providing the name parameter will override the export name. By default the member name is taken.

  3. class global extends Annotation with StaticAnnotation

    val and var members marked with this annotation are exported as a global field.

    val and var members marked with this annotation are exported as a global field. vals are exported as constant global, and vars as mutable global.

    The member type must have a SimpleValueFormatter.

    Providing the name parameter will override the export name. By default the member name is taken.

  4. macro class module extends Annotation with StaticAnnotation

    Classes annotated with this annotation get an automatic AsInstance with exported members annotated with global

    Classes annotated with this annotation get an automatic AsInstance with exported members annotated with global

    Annotations
    @compileTimeOnly("macro paradise plugin must be enabled")
  5. class pure extends Annotation with StaticAnnotation

    def members marked with this annotation are exported as pure functions.

    def members marked with this annotation are exported as pure functions. If you want to make side-effects, throw exctpion, and so on, please use effectful instead.

    The parameter and return types must have a SimpleValueFormatter.

    Providing the name parameter will override the export name. By default the member name is taken.

Ungrouped