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
  • AsInstance
  • AsInterface
  • Elem
  • Imports
  • TCMap

trait Imports[F[_]] extends AnyRef

Represents the imported elements of an instance. These can either be other module Instances or Scala functions and variables made available to interact between both worlds.

Source
Imports.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Imports
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def find(module: String, field: String): F[Interface[F, Type]]
  2. abstract def updated[T](module: String, m: T)(implicit I: AsInstance[T, F]): Imports[F]