manifold:internal 0.2.0
Contract reference · Payloads · contract.json (crates/manifold-wasm-abi/wit/contract.json)
Status: internal: linked only by hosts built with the contract-internal feature (host tests); refused for mods.
manifold:internal: interfaces for host tests (contract foundation spec
§8.4). A host links them only when built with the contract-internal
feature, which host tests and the parity harness enable and release builds
never do; the import check refuses them everywhere else.
The probe interfaces exercise the old-track machinery before any track is
released (spec §6.6, §16.1): wit-synthetic/0.1/internal/ holds a
synthetic previous track of this package, a guest built against it has its
probe imports served by a generated adapter, and its plugin-probe
export is called through a generated facade, on both hosts.
| Interface | Kind |
|---|---|
plugin-probe | export |
probe | import |
shapes | types-only |
Interface plugin-probe
export · since 0.2.0
The guest export the host calls through a facade. Track 0.2 added the
halt case to command, so a track-0.1 guest cannot receive it.
Functions
name
name: func() -> string
The guest’s name and the track it was built for.
run
run: func(cmd: command, c: borrow<counter>) -> result<outcome, string>
Run cmd against c, calling back into probe.
Types
command (variant)
| Index | Case | Payload | About |
|---|---|---|---|
| 0 | step | u32 | |
| 1 | jump | point | |
| 2 | report | list<string> | |
| 3 | halt | none |
counter (alias)
= internal/probe.counter
outcome (record)
| Field | Type | About |
|---|---|---|
total | u32 | |
last | option<point> | |
log | list<string> |
point (alias)
= internal/shapes.point
Interface probe
import · since 0.2.0
A host interface with a resource, records, variants, options and lists. Unchanged since track 0.1: its 0.1 adapter is generated.
Resources: counter.
Functions
[constructor]counter
[constructor]counter: func(start: u32) -> own<counter>
[method]counter.bump
[method]counter.bump: func(self: borrow<counter>, by: u32) -> u32
echo
echo: func(e: event) -> list<event>
The events the host saw, e last.
read
read: func(c: borrow<counter>) -> u32
The counter’s value.
record-reading
record-reading: func(r: reading) -> result<u32, string>
Store a reading; its index, or why it was refused.
Types
counter (resource)
A host-owned counter, one Rust host type on every track.
resource
event (variant)
| Index | Case | Payload | About |
|---|---|---|---|
| 0 | moved | point | |
| 1 | named | string | |
| 2 | cleared | none |
marks (alias)
= internal/shapes.marks
point (alias)
= internal/shapes.point
reading (record)
| Field | Type | About |
|---|---|---|
at | point | |
tone | tone | |
marks | marks | |
note | option<string> | |
samples | list<u16> |
tone (alias)
= internal/shapes.tone
Interface shapes
types-only · since 0.2.0
Types shared by the probe interfaces. Identical on every track, so an
older track’s bindings map it to the current Rust types with with:.
Types
marks (flags)
| Bit | Flag | About |
|---|---|---|
| 0 | red | |
| 1 | blue |
point (record)
| Field | Type | About |
|---|---|---|
x | s32 | |
y | s32 |
tone (enum)
| Index | Case | About |
|---|---|---|
| 0 | low | |
| 1 | high |
World probe-guest
A probe guest: imports probe, exports plugin-probe.
Imports:
manifold:internal/probe@0.2.0manifold:internal/shapes@0.2.0
Exports:
manifold:internal/plugin-probe@0.2.0