liveBook · Manning

Library component

As explained in Server-Side WebAssembly

A library component is a WebAssembly component that provides functions or interfaces for use by other components.

A library component is a WebAssembly component that exports functions or interfaces for other components to use. Its exports match imports declared through WIT. section 4.5

Hello from Lib

A library component exports hello-world and returns "Hello from Lib!". A binary component imports that function through bin.wit; composing and running the result prints the library’s string.

How Server-Side WebAssembly covers it

How deep it goes
Explains WIT declarations, generated Rust bindings, Cargo configuration, builds, plugging, and execution.
Examples
Uses a hello-world string function implemented in lib.rs, imported by bin.wit, and executed from a composed Wasm artifact.
What it assumes
Assumes Rust project configuration and WIT familiarity while supplying the interface, Cargo, implementation, and command-line steps.
What you can do after
Build it from scratch, compose it with wac, and run the resulting component with wasmtime.
How it connects
Connects WebAssembly components with WIT, Rust, binary components, generated bindings, and wac.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Server-Side WebAssembly. The section links point to the parts of the book it draws on.