Skip to main content

cove_runtime/
lib.rs

1//! The Cove runtime: values, Host API dispatch, and the MVP interpreter.
2
3pub mod budget;
4pub mod builtins;
5pub mod clock;
6pub mod database;
7pub mod embed;
8pub mod error;
9pub mod files;
10pub mod heap;
11pub mod host;
12pub mod http;
13pub mod interp;
14// Private: what it holds is one check both backends make, and the public
15// surface of it is `Interpreter::invoke` and `Vm::invoke`.
16mod invoke;
17// Private, with one type re-exported below: the execution backend of ADR
18// 0034. The module stays private so that what a caller can name is decided
19// here rather than by which items inside it happen to be `pub` — the words,
20// the layouts, the memory and the dispatch loop are the representation this
21// boundary exists to keep in.
22pub mod process;
23pub mod runtime;
24pub mod schema;
25pub mod shared;
26pub mod task;
27pub mod trace;
28pub mod value;
29mod vm;
30// Private: one type, and on every platform but `wasm32-unknown-unknown` it is
31// `std::time::Instant` re-exported. See the module for why the exception
32// exists and what a deadline does under it.
33mod wallclock;
34
35pub use budget::{Budget, Cancellation, Limits, Meter, Stopped};
36pub use clock::{Clock, VirtualTime};
37pub use database::Database;
38pub use error::RuntimeError;
39pub use files::Files;
40pub use heap::{Collection, HeapStats};
41pub use host::{
42    shipped_schema, Console, Documents, Env, GrantSource, Grants, HostApi, HostRegistry, NoReentry,
43    Reentry, ResourceHandle,
44};
45pub use http::{Http, ScriptedRequest, Served};
46pub use interp::{on_cove_stack, STACK_SIZE};
47pub use process::{Process, ProcessLog};
48pub use runtime::{Runtime, ENTRY_TASK};
49pub use schema::{
50    Admits, Effect, FieldSchema, HostType, Mismatch, ModuleSchema, OperationSchema, Part,
51    ResourceSchema, TypeSchema,
52};
53pub use shared::SharedCell;
54pub use task::Transfer;
55pub use trace::{
56    create_trace_file, value_to_json, HostOutcome, JsonlSink, NullSink, RecordedValue,
57    RecordingBackend, RunOutcome, TraceEvent, TraceHeader, TraceSink, ValueCapture,
58    RUNTIME_VERSION, TRACE_FORMAT_VERSION,
59};
60pub use value::{Value, ValueView};
61// The machine side of issue #241's debugger. The module is private like the
62// rest of `vm`, and what leaves it is a trait to implement, an answer to give,
63// and the owned snapshots a stop hands out — no word, no frame, no piece of
64// the representation `vm` exists to keep in.
65pub use vm::debug::{Call, Debugger, Field, Line, Local, Object, Resume, Stop, Word};
66pub use vm::exec::SAFEPOINT_STRIDE;
67pub use vm::profile::{Cost, Profiler};
68pub use vm::Vm;