Expand description
rusm-otp — the Wasm-free Erlang/OTP core of RUSM.
Lightweight processes (Tokio tasks), each with a message mailbox, over a
sharded process table. A process is killed by aborting its task — Tokio gives
us that handle for free — so a process carries just one channel. This crate
must never depend on or reference Wasmtime — the actor model stands alone;
Wasm is a separate, optional backend (rusm-wasm). See docs/01-architecture.md.
Structs§
- Context
- What a process body receives when it starts: its own
Pidand its mailbox — the receiving end of its message queue. - Monitor
Ref - Identifies a monitor set up with
monitor; echoed back in the resultingReceived::Downso a watcher can tell its monitors apart. - Pid
- A process identifier, unique within a
Runtime. - Process
Handle - A handle to a spawned process: address it (
kill) and await it (join). - Process
Info - A point-in-time snapshot of a live process for observability — the analogue
of Erlang’s
Process.info/1. Cheap to produce (a single table lookup). Run vs. suspended status is deliberately omitted: Tokio doesn’t expose a task’s park state, and faking it would mislead. - Runtime
- Spawns and tracks lightweight processes. Cheap to clone — clones share the same process table and counters.
- Stream
Handle - The read end of a byte stream, delivered as
Received::Stream. Single-consumer: ownership moves to the recipient, like every message. - Stream
Writer - The write end of a byte stream. Bounded:
writeawaits when the buffer is full, so production can’t outrun a slow consumer. Dropping the writer ends the stream (the reader then seesNone). - Supervisor
- Builder for a supervisor process. Create with
Runtime::supervisor, add children, thenstart. - Timer
Ref - A handle to a pending timer from
send_after.
Enums§
- Exit
Reason - Why a process terminated — carried to linked and monitoring processes.
- LogLevel
- Platform log verbosity, declared via
rusm.toml [log] level. Ordered, cumulative: a configured level shows every event at or below it. Each lifecycle event maps to a distinct level —Error: a crash (a trap / OOM);Warn: + a kill (or cascade);Info: + a clean exit;Debug: + every spawn. So a restart reads as a crashexit(Error) then a freshspawn(Debug). - Received
- What a process pulls from its mailbox with
recv: an ordinary message, a byte stream, or a system notification the runtime injected. Exit and down signals share the one mailbox (and FIFO order) with user messages — exactly as Erlang delivers{'EXIT', …}/{'DOWN', …}. - Strategy
- How a supervisor reacts when one child dies.
Functions§
- stream
- A connected
(writer, reader)byte-stream pair with the default buffer. - stream_
with_ capacity - A connected pair with an explicit buffer depth (clamped to at least 1).
Type Aliases§
- Message
- A user message delivered to a process mailbox.