Crate beck_rt

Crate beck_rt 

Source
Expand description

The Beck runtime — the effectful host a compiled program runs on.

docs/05-tier-lowering.md §5.2 calls this “the ‘Roc platform’ of Beck — an effectful Rust host owning I/O, scheduling and memory, executing the pure program”. Concretely: the log engine, the sequencer, the structural differ, the patch protocol, the websocket, and the SSR path.

Phase 0 built all of this against one hand-written application. The interesting property of Phase 1 is what is missing here: no Todo, no Command, no view. Those arrive as compiled Core through program::Runtime.

Re-exports§

pub use app::replay_from_genesis;
pub use app::replay_to;
pub use app::App;
pub use app::AppConfig;
pub use dash::Dashboard;
pub use dash::ResourceRow;
pub use log::Durability;
pub use log::LogStore;
pub use log::MemoryLog;
pub use log::PgLog;
pub use log::RedbLog;
pub use log::SqliteLog;
pub use patch::Codec;
pub use patch::PatchFrame;
pub use telemetry::telemetry;
pub use telemetry::timed;
pub use telemetry::Telemetry;
pub use testing::run as run_tests;
pub use testing::Case;
pub use testing::Options as TestOptions;
pub use testing::Outcome;
pub use testing::Report as TestReport;

Modules§

app
The application: one merge point, one sequencer, one durable fold, N per-session views.
awareness
What everybody is doing now — the roster awareness(f) reads.
dash
The dashboard: resources, the dependency graph, metrics and logs, from the one program.
diff
Structural diff of two Html values — the producer half of “the browser is fold(apply_patch, initial_html, patch_stream)”.
http
HTTP: the first paint, the assets, the probes, and the websocket upgrade.
identity
Who is asking, as a thing the runtime decides rather than a thing the client asserts.
log
The log engine — “the log is the database” (§5.3).
oidc
An OpenID Connect relying party — the half of docs/10 D6 that 48 §48.13 named as unbuilt.
outbound
The outbound HTTP client: beck_core::net::Outbound, over hyper.
patch
Patch frames and their encodings.
pgwire
The PostgreSQL wire protocol, served over a program’s read models.
presence
Who is connected now — the roster presence() reads.
program
The compiled program and the wire it speaks on, from beck_host — the half of this platform that is program-shaped rather than machine-shaped, and that a browser tab therefore also runs (docs/17-playground.md §17.2). Re-exported at the paths they have always had: beck_rt::program::Runtime is beck_host::program::Runtime. The bridge between a compiled program and the runtime that drives it.
protocol
The compiled program and the wire it speaks on, from beck_host — the half of this platform that is program-shaped rather than machine-shaped, and that a browser tab therefore also runs (docs/17-playground.md §17.2). Re-exported at the paths they have always had: beck_rt::program::Runtime is beck_host::program::Runtime. The socket protocol: one connection multiplexing patches down and commands up (§5.1).
quota
F3’s per-actor write quota: how much one actor may turn into permanent storage.
session
One subscription: the client half of the tier crossing the splitter found.
signals
The signal graph a devtools panel draws, as JSON.
telemetry
Telemetry — and the question of what it is for, in an architecture that already has a log.
testing
The beck test runner — docs/21-tests-in-beck-and-proof.md §21.2 and §21.3, executed.

Structs§

Envelope
The records a log is made of, defined in beck_host::record because a browser tab holds a log too and an envelope has to mean the same thing in both (docs/17 §17.2). What is here is the engine: the substrates, and the contract above. A durably logged occurrence. The fields are §3.7’s, and actor is a stable identity — never the live Session capability or a token (F5).
Instant
The records a log is made of, defined in beck_host::record because a browser tab holds a log too and an envelope has to mean the same thing in both (docs/17 §17.2). What is here is the engine: the substrates, and the contract above. Wall-clock instant, milliseconds since the Unix epoch, captured at ingress as data.
Runtime
The compiled program plus the capabilities the host holds on its behalf.
Snapshot
The records a log is made of, defined in beck_host::record because a browser tab holds a log too and an envelope has to mean the same thing in both (docs/17 §17.2). What is here is the engine: the substrates, and the contract above. A snapshot of the durable fold: the accumulator plus the position it was taken at.

Enums§

Op

Constants§

DEVTOOLS_CLIENT
The devtools panel: the signal graph, the patch traffic and the pending commands.
MODE_B_CLIENT
Mode B: load the kernel, hold the state, render locally ([beck_core::render]).
PATCH_CLIENT
The patch interpreter and the socket, shared by both rendering modes (§5.1).
SERVICE_WORKER
Mode B’s service worker: the shell, cached, so a cold start with no network is a page.
THIN_CLIENT
Mode A: apply the patches the server sends, post commands back up the socket.

Functions§

diff
Diff two views of the same frame.

Type Aliases§

Path
A node address: child indices from the root of the subscription’s frame.
Seq
The records a log is made of, defined in beck_host::record because a browser tab holds a log too and an envelope has to mean the same thing in both (docs/17 §17.2). What is here is the engine: the substrates, and the contract above. Position in the total order. One totally-ordered log per application (§3.7 v1 semantics).